@checkstack/notification-backend 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +133 -0
- package/drizzle/0000_tan_stryfe.sql +28 -0
- package/drizzle/0001_futuristic_apocalypse.sql +11 -0
- package/drizzle/0002_early_the_spike.sql +3 -0
- package/drizzle/0003_tiny_wendell_vaughn.sql +1 -0
- package/drizzle/0004_regular_corsair.sql +4 -0
- package/drizzle/meta/0000_snapshot.json +188 -0
- package/drizzle/meta/0001_snapshot.json +260 -0
- package/drizzle/meta/0002_snapshot.json +278 -0
- package/drizzle/meta/0003_snapshot.json +188 -0
- package/drizzle/meta/0004_snapshot.json +188 -0
- package/drizzle/meta/_journal.json +41 -0
- package/drizzle.config.ts +8 -0
- package/package.json +37 -0
- package/src/index.ts +280 -0
- package/src/oauth-callback-handler.ts +209 -0
- package/src/retention-config.ts +30 -0
- package/src/router.test.ts +38 -0
- package/src/router.ts +1090 -0
- package/src/schema.ts +54 -0
- package/src/service.ts +216 -0
- package/src/strategy-service.test.ts +478 -0
- package/src/strategy-service.ts +551 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "dda9baf2-dc9e-4d23-bc78-4ce55a322db3",
|
|
3
|
+
"prevId": "48c3ed25-41a5-4baa-a7e4-59cdc42c7486",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.notification_groups": {
|
|
8
|
+
"name": "notification_groups",
|
|
9
|
+
"schema": "",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "text",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true
|
|
16
|
+
},
|
|
17
|
+
"name": {
|
|
18
|
+
"name": "name",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true
|
|
22
|
+
},
|
|
23
|
+
"description": {
|
|
24
|
+
"name": "description",
|
|
25
|
+
"type": "text",
|
|
26
|
+
"primaryKey": false,
|
|
27
|
+
"notNull": true
|
|
28
|
+
},
|
|
29
|
+
"owner_plugin": {
|
|
30
|
+
"name": "owner_plugin",
|
|
31
|
+
"type": "text",
|
|
32
|
+
"primaryKey": false,
|
|
33
|
+
"notNull": true
|
|
34
|
+
},
|
|
35
|
+
"created_at": {
|
|
36
|
+
"name": "created_at",
|
|
37
|
+
"type": "timestamp",
|
|
38
|
+
"primaryKey": false,
|
|
39
|
+
"notNull": true,
|
|
40
|
+
"default": "now()"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"indexes": {},
|
|
44
|
+
"foreignKeys": {},
|
|
45
|
+
"compositePrimaryKeys": {},
|
|
46
|
+
"uniqueConstraints": {},
|
|
47
|
+
"policies": {},
|
|
48
|
+
"checkConstraints": {},
|
|
49
|
+
"isRLSEnabled": false
|
|
50
|
+
},
|
|
51
|
+
"public.notification_subscriptions": {
|
|
52
|
+
"name": "notification_subscriptions",
|
|
53
|
+
"schema": "",
|
|
54
|
+
"columns": {
|
|
55
|
+
"user_id": {
|
|
56
|
+
"name": "user_id",
|
|
57
|
+
"type": "text",
|
|
58
|
+
"primaryKey": false,
|
|
59
|
+
"notNull": true
|
|
60
|
+
},
|
|
61
|
+
"group_id": {
|
|
62
|
+
"name": "group_id",
|
|
63
|
+
"type": "text",
|
|
64
|
+
"primaryKey": false,
|
|
65
|
+
"notNull": true
|
|
66
|
+
},
|
|
67
|
+
"subscribed_at": {
|
|
68
|
+
"name": "subscribed_at",
|
|
69
|
+
"type": "timestamp",
|
|
70
|
+
"primaryKey": false,
|
|
71
|
+
"notNull": true,
|
|
72
|
+
"default": "now()"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"indexes": {},
|
|
76
|
+
"foreignKeys": {
|
|
77
|
+
"notification_subscriptions_group_id_notification_groups_id_fk": {
|
|
78
|
+
"name": "notification_subscriptions_group_id_notification_groups_id_fk",
|
|
79
|
+
"tableFrom": "notification_subscriptions",
|
|
80
|
+
"tableTo": "notification_groups",
|
|
81
|
+
"columnsFrom": [
|
|
82
|
+
"group_id"
|
|
83
|
+
],
|
|
84
|
+
"columnsTo": [
|
|
85
|
+
"id"
|
|
86
|
+
],
|
|
87
|
+
"onDelete": "cascade",
|
|
88
|
+
"onUpdate": "no action"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"compositePrimaryKeys": {
|
|
92
|
+
"notification_subscriptions_user_id_group_id_pk": {
|
|
93
|
+
"name": "notification_subscriptions_user_id_group_id_pk",
|
|
94
|
+
"columns": [
|
|
95
|
+
"user_id",
|
|
96
|
+
"group_id"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"uniqueConstraints": {},
|
|
101
|
+
"policies": {},
|
|
102
|
+
"checkConstraints": {},
|
|
103
|
+
"isRLSEnabled": false
|
|
104
|
+
},
|
|
105
|
+
"public.notifications": {
|
|
106
|
+
"name": "notifications",
|
|
107
|
+
"schema": "",
|
|
108
|
+
"columns": {
|
|
109
|
+
"id": {
|
|
110
|
+
"name": "id",
|
|
111
|
+
"type": "uuid",
|
|
112
|
+
"primaryKey": true,
|
|
113
|
+
"notNull": true,
|
|
114
|
+
"default": "gen_random_uuid()"
|
|
115
|
+
},
|
|
116
|
+
"user_id": {
|
|
117
|
+
"name": "user_id",
|
|
118
|
+
"type": "text",
|
|
119
|
+
"primaryKey": false,
|
|
120
|
+
"notNull": true
|
|
121
|
+
},
|
|
122
|
+
"title": {
|
|
123
|
+
"name": "title",
|
|
124
|
+
"type": "text",
|
|
125
|
+
"primaryKey": false,
|
|
126
|
+
"notNull": true
|
|
127
|
+
},
|
|
128
|
+
"description": {
|
|
129
|
+
"name": "description",
|
|
130
|
+
"type": "text",
|
|
131
|
+
"primaryKey": false,
|
|
132
|
+
"notNull": true
|
|
133
|
+
},
|
|
134
|
+
"actions": {
|
|
135
|
+
"name": "actions",
|
|
136
|
+
"type": "jsonb",
|
|
137
|
+
"primaryKey": false,
|
|
138
|
+
"notNull": false
|
|
139
|
+
},
|
|
140
|
+
"importance": {
|
|
141
|
+
"name": "importance",
|
|
142
|
+
"type": "text",
|
|
143
|
+
"primaryKey": false,
|
|
144
|
+
"notNull": true,
|
|
145
|
+
"default": "'info'"
|
|
146
|
+
},
|
|
147
|
+
"is_read": {
|
|
148
|
+
"name": "is_read",
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"primaryKey": false,
|
|
151
|
+
"notNull": true,
|
|
152
|
+
"default": false
|
|
153
|
+
},
|
|
154
|
+
"group_id": {
|
|
155
|
+
"name": "group_id",
|
|
156
|
+
"type": "text",
|
|
157
|
+
"primaryKey": false,
|
|
158
|
+
"notNull": false
|
|
159
|
+
},
|
|
160
|
+
"created_at": {
|
|
161
|
+
"name": "created_at",
|
|
162
|
+
"type": "timestamp",
|
|
163
|
+
"primaryKey": false,
|
|
164
|
+
"notNull": true,
|
|
165
|
+
"default": "now()"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"indexes": {},
|
|
169
|
+
"foreignKeys": {},
|
|
170
|
+
"compositePrimaryKeys": {},
|
|
171
|
+
"uniqueConstraints": {},
|
|
172
|
+
"policies": {},
|
|
173
|
+
"checkConstraints": {},
|
|
174
|
+
"isRLSEnabled": false
|
|
175
|
+
},
|
|
176
|
+
"public.user_notification_preferences": {
|
|
177
|
+
"name": "user_notification_preferences",
|
|
178
|
+
"schema": "",
|
|
179
|
+
"columns": {
|
|
180
|
+
"user_id": {
|
|
181
|
+
"name": "user_id",
|
|
182
|
+
"type": "text",
|
|
183
|
+
"primaryKey": false,
|
|
184
|
+
"notNull": true
|
|
185
|
+
},
|
|
186
|
+
"strategy_id": {
|
|
187
|
+
"name": "strategy_id",
|
|
188
|
+
"type": "text",
|
|
189
|
+
"primaryKey": false,
|
|
190
|
+
"notNull": true
|
|
191
|
+
},
|
|
192
|
+
"config": {
|
|
193
|
+
"name": "config",
|
|
194
|
+
"type": "jsonb",
|
|
195
|
+
"primaryKey": false,
|
|
196
|
+
"notNull": false
|
|
197
|
+
},
|
|
198
|
+
"enabled": {
|
|
199
|
+
"name": "enabled",
|
|
200
|
+
"type": "boolean",
|
|
201
|
+
"primaryKey": false,
|
|
202
|
+
"notNull": true,
|
|
203
|
+
"default": true
|
|
204
|
+
},
|
|
205
|
+
"external_id": {
|
|
206
|
+
"name": "external_id",
|
|
207
|
+
"type": "text",
|
|
208
|
+
"primaryKey": false,
|
|
209
|
+
"notNull": false
|
|
210
|
+
},
|
|
211
|
+
"access_token": {
|
|
212
|
+
"name": "access_token",
|
|
213
|
+
"type": "text",
|
|
214
|
+
"primaryKey": false,
|
|
215
|
+
"notNull": false
|
|
216
|
+
},
|
|
217
|
+
"refresh_token": {
|
|
218
|
+
"name": "refresh_token",
|
|
219
|
+
"type": "text",
|
|
220
|
+
"primaryKey": false,
|
|
221
|
+
"notNull": false
|
|
222
|
+
},
|
|
223
|
+
"token_expires_at": {
|
|
224
|
+
"name": "token_expires_at",
|
|
225
|
+
"type": "timestamp",
|
|
226
|
+
"primaryKey": false,
|
|
227
|
+
"notNull": false
|
|
228
|
+
},
|
|
229
|
+
"linked_at": {
|
|
230
|
+
"name": "linked_at",
|
|
231
|
+
"type": "timestamp",
|
|
232
|
+
"primaryKey": false,
|
|
233
|
+
"notNull": false
|
|
234
|
+
},
|
|
235
|
+
"created_at": {
|
|
236
|
+
"name": "created_at",
|
|
237
|
+
"type": "timestamp",
|
|
238
|
+
"primaryKey": false,
|
|
239
|
+
"notNull": true,
|
|
240
|
+
"default": "now()"
|
|
241
|
+
},
|
|
242
|
+
"updated_at": {
|
|
243
|
+
"name": "updated_at",
|
|
244
|
+
"type": "timestamp",
|
|
245
|
+
"primaryKey": false,
|
|
246
|
+
"notNull": true,
|
|
247
|
+
"default": "now()"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"indexes": {},
|
|
251
|
+
"foreignKeys": {},
|
|
252
|
+
"compositePrimaryKeys": {
|
|
253
|
+
"user_notification_preferences_user_id_strategy_id_pk": {
|
|
254
|
+
"name": "user_notification_preferences_user_id_strategy_id_pk",
|
|
255
|
+
"columns": [
|
|
256
|
+
"user_id",
|
|
257
|
+
"strategy_id"
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"uniqueConstraints": {},
|
|
262
|
+
"policies": {},
|
|
263
|
+
"checkConstraints": {},
|
|
264
|
+
"isRLSEnabled": false
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
"enums": {},
|
|
268
|
+
"schemas": {},
|
|
269
|
+
"sequences": {},
|
|
270
|
+
"roles": {},
|
|
271
|
+
"policies": {},
|
|
272
|
+
"views": {},
|
|
273
|
+
"_meta": {
|
|
274
|
+
"columns": {},
|
|
275
|
+
"schemas": {},
|
|
276
|
+
"tables": {}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "3a4b6e40-c81d-4fea-b8e5-75bed38d13b4",
|
|
3
|
+
"prevId": "dda9baf2-dc9e-4d23-bc78-4ce55a322db3",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.notification_groups": {
|
|
8
|
+
"name": "notification_groups",
|
|
9
|
+
"schema": "",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "text",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true
|
|
16
|
+
},
|
|
17
|
+
"name": {
|
|
18
|
+
"name": "name",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true
|
|
22
|
+
},
|
|
23
|
+
"description": {
|
|
24
|
+
"name": "description",
|
|
25
|
+
"type": "text",
|
|
26
|
+
"primaryKey": false,
|
|
27
|
+
"notNull": true
|
|
28
|
+
},
|
|
29
|
+
"owner_plugin": {
|
|
30
|
+
"name": "owner_plugin",
|
|
31
|
+
"type": "text",
|
|
32
|
+
"primaryKey": false,
|
|
33
|
+
"notNull": true
|
|
34
|
+
},
|
|
35
|
+
"created_at": {
|
|
36
|
+
"name": "created_at",
|
|
37
|
+
"type": "timestamp",
|
|
38
|
+
"primaryKey": false,
|
|
39
|
+
"notNull": true,
|
|
40
|
+
"default": "now()"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"indexes": {},
|
|
44
|
+
"foreignKeys": {},
|
|
45
|
+
"compositePrimaryKeys": {},
|
|
46
|
+
"uniqueConstraints": {},
|
|
47
|
+
"policies": {},
|
|
48
|
+
"checkConstraints": {},
|
|
49
|
+
"isRLSEnabled": false
|
|
50
|
+
},
|
|
51
|
+
"public.notification_subscriptions": {
|
|
52
|
+
"name": "notification_subscriptions",
|
|
53
|
+
"schema": "",
|
|
54
|
+
"columns": {
|
|
55
|
+
"user_id": {
|
|
56
|
+
"name": "user_id",
|
|
57
|
+
"type": "text",
|
|
58
|
+
"primaryKey": false,
|
|
59
|
+
"notNull": true
|
|
60
|
+
},
|
|
61
|
+
"group_id": {
|
|
62
|
+
"name": "group_id",
|
|
63
|
+
"type": "text",
|
|
64
|
+
"primaryKey": false,
|
|
65
|
+
"notNull": true
|
|
66
|
+
},
|
|
67
|
+
"subscribed_at": {
|
|
68
|
+
"name": "subscribed_at",
|
|
69
|
+
"type": "timestamp",
|
|
70
|
+
"primaryKey": false,
|
|
71
|
+
"notNull": true,
|
|
72
|
+
"default": "now()"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"indexes": {},
|
|
76
|
+
"foreignKeys": {
|
|
77
|
+
"notification_subscriptions_group_id_notification_groups_id_fk": {
|
|
78
|
+
"name": "notification_subscriptions_group_id_notification_groups_id_fk",
|
|
79
|
+
"tableFrom": "notification_subscriptions",
|
|
80
|
+
"tableTo": "notification_groups",
|
|
81
|
+
"columnsFrom": [
|
|
82
|
+
"group_id"
|
|
83
|
+
],
|
|
84
|
+
"columnsTo": [
|
|
85
|
+
"id"
|
|
86
|
+
],
|
|
87
|
+
"onDelete": "cascade",
|
|
88
|
+
"onUpdate": "no action"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"compositePrimaryKeys": {
|
|
92
|
+
"notification_subscriptions_user_id_group_id_pk": {
|
|
93
|
+
"name": "notification_subscriptions_user_id_group_id_pk",
|
|
94
|
+
"columns": [
|
|
95
|
+
"user_id",
|
|
96
|
+
"group_id"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"uniqueConstraints": {},
|
|
101
|
+
"policies": {},
|
|
102
|
+
"checkConstraints": {},
|
|
103
|
+
"isRLSEnabled": false
|
|
104
|
+
},
|
|
105
|
+
"public.notifications": {
|
|
106
|
+
"name": "notifications",
|
|
107
|
+
"schema": "",
|
|
108
|
+
"columns": {
|
|
109
|
+
"id": {
|
|
110
|
+
"name": "id",
|
|
111
|
+
"type": "uuid",
|
|
112
|
+
"primaryKey": true,
|
|
113
|
+
"notNull": true,
|
|
114
|
+
"default": "gen_random_uuid()"
|
|
115
|
+
},
|
|
116
|
+
"user_id": {
|
|
117
|
+
"name": "user_id",
|
|
118
|
+
"type": "text",
|
|
119
|
+
"primaryKey": false,
|
|
120
|
+
"notNull": true
|
|
121
|
+
},
|
|
122
|
+
"title": {
|
|
123
|
+
"name": "title",
|
|
124
|
+
"type": "text",
|
|
125
|
+
"primaryKey": false,
|
|
126
|
+
"notNull": true
|
|
127
|
+
},
|
|
128
|
+
"description": {
|
|
129
|
+
"name": "description",
|
|
130
|
+
"type": "text",
|
|
131
|
+
"primaryKey": false,
|
|
132
|
+
"notNull": true
|
|
133
|
+
},
|
|
134
|
+
"actions": {
|
|
135
|
+
"name": "actions",
|
|
136
|
+
"type": "jsonb",
|
|
137
|
+
"primaryKey": false,
|
|
138
|
+
"notNull": false
|
|
139
|
+
},
|
|
140
|
+
"importance": {
|
|
141
|
+
"name": "importance",
|
|
142
|
+
"type": "text",
|
|
143
|
+
"primaryKey": false,
|
|
144
|
+
"notNull": true,
|
|
145
|
+
"default": "'info'"
|
|
146
|
+
},
|
|
147
|
+
"is_read": {
|
|
148
|
+
"name": "is_read",
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"primaryKey": false,
|
|
151
|
+
"notNull": true,
|
|
152
|
+
"default": false
|
|
153
|
+
},
|
|
154
|
+
"group_id": {
|
|
155
|
+
"name": "group_id",
|
|
156
|
+
"type": "text",
|
|
157
|
+
"primaryKey": false,
|
|
158
|
+
"notNull": false
|
|
159
|
+
},
|
|
160
|
+
"created_at": {
|
|
161
|
+
"name": "created_at",
|
|
162
|
+
"type": "timestamp",
|
|
163
|
+
"primaryKey": false,
|
|
164
|
+
"notNull": true,
|
|
165
|
+
"default": "now()"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"indexes": {},
|
|
169
|
+
"foreignKeys": {},
|
|
170
|
+
"compositePrimaryKeys": {},
|
|
171
|
+
"uniqueConstraints": {},
|
|
172
|
+
"policies": {},
|
|
173
|
+
"checkConstraints": {},
|
|
174
|
+
"isRLSEnabled": false
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"enums": {},
|
|
178
|
+
"schemas": {},
|
|
179
|
+
"sequences": {},
|
|
180
|
+
"roles": {},
|
|
181
|
+
"policies": {},
|
|
182
|
+
"views": {},
|
|
183
|
+
"_meta": {
|
|
184
|
+
"columns": {},
|
|
185
|
+
"schemas": {},
|
|
186
|
+
"tables": {}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "5899e448-f29a-46e2-b75d-51c7832c432b",
|
|
3
|
+
"prevId": "3a4b6e40-c81d-4fea-b8e5-75bed38d13b4",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.notification_groups": {
|
|
8
|
+
"name": "notification_groups",
|
|
9
|
+
"schema": "",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "text",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true
|
|
16
|
+
},
|
|
17
|
+
"name": {
|
|
18
|
+
"name": "name",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true
|
|
22
|
+
},
|
|
23
|
+
"description": {
|
|
24
|
+
"name": "description",
|
|
25
|
+
"type": "text",
|
|
26
|
+
"primaryKey": false,
|
|
27
|
+
"notNull": true
|
|
28
|
+
},
|
|
29
|
+
"owner_plugin": {
|
|
30
|
+
"name": "owner_plugin",
|
|
31
|
+
"type": "text",
|
|
32
|
+
"primaryKey": false,
|
|
33
|
+
"notNull": true
|
|
34
|
+
},
|
|
35
|
+
"created_at": {
|
|
36
|
+
"name": "created_at",
|
|
37
|
+
"type": "timestamp",
|
|
38
|
+
"primaryKey": false,
|
|
39
|
+
"notNull": true,
|
|
40
|
+
"default": "now()"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"indexes": {},
|
|
44
|
+
"foreignKeys": {},
|
|
45
|
+
"compositePrimaryKeys": {},
|
|
46
|
+
"uniqueConstraints": {},
|
|
47
|
+
"policies": {},
|
|
48
|
+
"checkConstraints": {},
|
|
49
|
+
"isRLSEnabled": false
|
|
50
|
+
},
|
|
51
|
+
"public.notification_subscriptions": {
|
|
52
|
+
"name": "notification_subscriptions",
|
|
53
|
+
"schema": "",
|
|
54
|
+
"columns": {
|
|
55
|
+
"user_id": {
|
|
56
|
+
"name": "user_id",
|
|
57
|
+
"type": "text",
|
|
58
|
+
"primaryKey": false,
|
|
59
|
+
"notNull": true
|
|
60
|
+
},
|
|
61
|
+
"group_id": {
|
|
62
|
+
"name": "group_id",
|
|
63
|
+
"type": "text",
|
|
64
|
+
"primaryKey": false,
|
|
65
|
+
"notNull": true
|
|
66
|
+
},
|
|
67
|
+
"subscribed_at": {
|
|
68
|
+
"name": "subscribed_at",
|
|
69
|
+
"type": "timestamp",
|
|
70
|
+
"primaryKey": false,
|
|
71
|
+
"notNull": true,
|
|
72
|
+
"default": "now()"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"indexes": {},
|
|
76
|
+
"foreignKeys": {
|
|
77
|
+
"notification_subscriptions_group_id_notification_groups_id_fk": {
|
|
78
|
+
"name": "notification_subscriptions_group_id_notification_groups_id_fk",
|
|
79
|
+
"tableFrom": "notification_subscriptions",
|
|
80
|
+
"tableTo": "notification_groups",
|
|
81
|
+
"columnsFrom": [
|
|
82
|
+
"group_id"
|
|
83
|
+
],
|
|
84
|
+
"columnsTo": [
|
|
85
|
+
"id"
|
|
86
|
+
],
|
|
87
|
+
"onDelete": "cascade",
|
|
88
|
+
"onUpdate": "no action"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"compositePrimaryKeys": {
|
|
92
|
+
"notification_subscriptions_user_id_group_id_pk": {
|
|
93
|
+
"name": "notification_subscriptions_user_id_group_id_pk",
|
|
94
|
+
"columns": [
|
|
95
|
+
"user_id",
|
|
96
|
+
"group_id"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"uniqueConstraints": {},
|
|
101
|
+
"policies": {},
|
|
102
|
+
"checkConstraints": {},
|
|
103
|
+
"isRLSEnabled": false
|
|
104
|
+
},
|
|
105
|
+
"public.notifications": {
|
|
106
|
+
"name": "notifications",
|
|
107
|
+
"schema": "",
|
|
108
|
+
"columns": {
|
|
109
|
+
"id": {
|
|
110
|
+
"name": "id",
|
|
111
|
+
"type": "uuid",
|
|
112
|
+
"primaryKey": true,
|
|
113
|
+
"notNull": true,
|
|
114
|
+
"default": "gen_random_uuid()"
|
|
115
|
+
},
|
|
116
|
+
"user_id": {
|
|
117
|
+
"name": "user_id",
|
|
118
|
+
"type": "text",
|
|
119
|
+
"primaryKey": false,
|
|
120
|
+
"notNull": true
|
|
121
|
+
},
|
|
122
|
+
"title": {
|
|
123
|
+
"name": "title",
|
|
124
|
+
"type": "text",
|
|
125
|
+
"primaryKey": false,
|
|
126
|
+
"notNull": true
|
|
127
|
+
},
|
|
128
|
+
"body": {
|
|
129
|
+
"name": "body",
|
|
130
|
+
"type": "text",
|
|
131
|
+
"primaryKey": false,
|
|
132
|
+
"notNull": true
|
|
133
|
+
},
|
|
134
|
+
"action": {
|
|
135
|
+
"name": "action",
|
|
136
|
+
"type": "jsonb",
|
|
137
|
+
"primaryKey": false,
|
|
138
|
+
"notNull": false
|
|
139
|
+
},
|
|
140
|
+
"importance": {
|
|
141
|
+
"name": "importance",
|
|
142
|
+
"type": "text",
|
|
143
|
+
"primaryKey": false,
|
|
144
|
+
"notNull": true,
|
|
145
|
+
"default": "'info'"
|
|
146
|
+
},
|
|
147
|
+
"is_read": {
|
|
148
|
+
"name": "is_read",
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"primaryKey": false,
|
|
151
|
+
"notNull": true,
|
|
152
|
+
"default": false
|
|
153
|
+
},
|
|
154
|
+
"group_id": {
|
|
155
|
+
"name": "group_id",
|
|
156
|
+
"type": "text",
|
|
157
|
+
"primaryKey": false,
|
|
158
|
+
"notNull": false
|
|
159
|
+
},
|
|
160
|
+
"created_at": {
|
|
161
|
+
"name": "created_at",
|
|
162
|
+
"type": "timestamp",
|
|
163
|
+
"primaryKey": false,
|
|
164
|
+
"notNull": true,
|
|
165
|
+
"default": "now()"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"indexes": {},
|
|
169
|
+
"foreignKeys": {},
|
|
170
|
+
"compositePrimaryKeys": {},
|
|
171
|
+
"uniqueConstraints": {},
|
|
172
|
+
"policies": {},
|
|
173
|
+
"checkConstraints": {},
|
|
174
|
+
"isRLSEnabled": false
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"enums": {},
|
|
178
|
+
"schemas": {},
|
|
179
|
+
"sequences": {},
|
|
180
|
+
"roles": {},
|
|
181
|
+
"policies": {},
|
|
182
|
+
"views": {},
|
|
183
|
+
"_meta": {
|
|
184
|
+
"columns": {},
|
|
185
|
+
"schemas": {},
|
|
186
|
+
"tables": {}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "7",
|
|
3
|
+
"dialect": "postgresql",
|
|
4
|
+
"entries": [
|
|
5
|
+
{
|
|
6
|
+
"idx": 0,
|
|
7
|
+
"version": "7",
|
|
8
|
+
"when": 1767319106023,
|
|
9
|
+
"tag": "0000_tan_stryfe",
|
|
10
|
+
"breakpoints": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"idx": 1,
|
|
14
|
+
"version": "7",
|
|
15
|
+
"when": 1767547905748,
|
|
16
|
+
"tag": "0001_futuristic_apocalypse",
|
|
17
|
+
"breakpoints": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"idx": 2,
|
|
21
|
+
"version": "7",
|
|
22
|
+
"when": 1767549661596,
|
|
23
|
+
"tag": "0002_early_the_spike",
|
|
24
|
+
"breakpoints": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"idx": 3,
|
|
28
|
+
"version": "7",
|
|
29
|
+
"when": 1767552186415,
|
|
30
|
+
"tag": "0003_tiny_wendell_vaughn",
|
|
31
|
+
"breakpoints": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"idx": 4,
|
|
35
|
+
"version": "7",
|
|
36
|
+
"when": 1767566076200,
|
|
37
|
+
"tag": "0004_regular_corsair",
|
|
38
|
+
"breakpoints": true
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|