@remit/drizzle-sqlite-schema 0.0.18 → 0.0.19
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/dist/schema.d.ts +2029 -1970
- package/dist/schema.js +44 -41
- package/package.json +1 -1
- package/schema.ts +54 -51
package/dist/schema.js
CHANGED
|
@@ -169,6 +169,47 @@ export const organizeJobRequests = sqliteTable("organize_job_request", {
|
|
|
169
169
|
}, (table) => [
|
|
170
170
|
index("organize_job_request_by_account_config_id").on(table.accountConfigId, table.createdAt),
|
|
171
171
|
]);
|
|
172
|
+
export const calendarCollections = sqliteTable("calendar", {
|
|
173
|
+
calendarId: text("calendar_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
174
|
+
accountConfigId: text("account_config_id").notNull(),
|
|
175
|
+
urlSegment: text("url_segment").notNull(),
|
|
176
|
+
displayName: text("display_name").notNull(),
|
|
177
|
+
color: text("color").$type().notNull().default("Cal1"),
|
|
178
|
+
componentSet: text("component_set").$type().notNull().default("VeventOnly"),
|
|
179
|
+
source: text("source").$type().notNull().default("UserCreated"),
|
|
180
|
+
timezone: text("timezone").notNull().default(""),
|
|
181
|
+
syncSequence: integer("sync_sequence", { mode: "number" }).notNull().default(0),
|
|
182
|
+
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
183
|
+
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
184
|
+
}, (table) => [
|
|
185
|
+
index("calendar_by_url_segment").on(table.accountConfigId, table.urlSegment),
|
|
186
|
+
index("calendar_primary").on(table.accountConfigId, table.calendarId),
|
|
187
|
+
]);
|
|
188
|
+
export const calendarObjects = sqliteTable("calendar_object", {
|
|
189
|
+
calendarObjectId: text("calendar_object_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
190
|
+
calendarId: text("calendar_id").notNull(),
|
|
191
|
+
resourceName: text("resource_name").notNull(),
|
|
192
|
+
icalUid: text("ical_uid").notNull(),
|
|
193
|
+
icalData: text("ical_data").notNull(),
|
|
194
|
+
etag: text("etag").notNull(),
|
|
195
|
+
sequence: integer("sequence").notNull().default(0),
|
|
196
|
+
syncSequence: integer("sync_sequence", { mode: "number" }).notNull().default(0),
|
|
197
|
+
summary: text("summary").notNull(),
|
|
198
|
+
dtStart: text("dt_start").notNull(),
|
|
199
|
+
dtEnd: text("dt_end").notNull(),
|
|
200
|
+
allDay: integer("all_day", { mode: "boolean" }).notNull().default(false),
|
|
201
|
+
zoneCertainty: text("zone_certainty").$type().notNull().default("Explicit"),
|
|
202
|
+
status: text("status").$type().notNull().default("Confirmed"),
|
|
203
|
+
transparency: text("transparency").$type().notNull().default("Opaque"),
|
|
204
|
+
hasRecurrence: integer("has_recurrence", { mode: "boolean" }).notNull().default(false),
|
|
205
|
+
expandedThrough: text("expanded_through").notNull().default(""),
|
|
206
|
+
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
207
|
+
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
208
|
+
}, (table) => [
|
|
209
|
+
index("calendar_object_by_sync_sequence").on(table.calendarId, table.syncSequence),
|
|
210
|
+
index("calendar_object_by_uid").on(table.calendarId, table.icalUid),
|
|
211
|
+
index("calendar_object_primary").on(table.calendarId, table.calendarObjectId),
|
|
212
|
+
]);
|
|
172
213
|
export const threadMessages = sqliteTable("thread_message", {
|
|
173
214
|
threadMessageId: text("thread_message_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
174
215
|
threadId: text("thread_id").notNull(),
|
|
@@ -525,47 +566,6 @@ export const bodyPartContents = sqliteTable("body_part_content", {
|
|
|
525
566
|
}, (table) => [
|
|
526
567
|
index("body_part_content_by_message_id").on(table.messageId, table.bodyPartContentId),
|
|
527
568
|
]);
|
|
528
|
-
export const calendarCollections = sqliteTable("calendar", {
|
|
529
|
-
calendarId: text("calendar_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
530
|
-
accountConfigId: text("account_config_id").notNull(),
|
|
531
|
-
urlSegment: text("url_segment").notNull(),
|
|
532
|
-
displayName: text("display_name").notNull(),
|
|
533
|
-
color: text("color").$type().notNull().default("Cal1"),
|
|
534
|
-
componentSet: text("component_set").$type().notNull().default("VeventOnly"),
|
|
535
|
-
source: text("source").$type().notNull().default("UserCreated"),
|
|
536
|
-
timezone: text("timezone").notNull().default(""),
|
|
537
|
-
syncSequence: integer("sync_sequence", { mode: "number" }).notNull().default(0),
|
|
538
|
-
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
539
|
-
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
540
|
-
}, (table) => [
|
|
541
|
-
index("calendar_by_url_segment").on(table.accountConfigId, table.urlSegment),
|
|
542
|
-
index("calendar_primary").on(table.accountConfigId, table.calendarId),
|
|
543
|
-
]);
|
|
544
|
-
export const calendarObjects = sqliteTable("calendar_object", {
|
|
545
|
-
calendarObjectId: text("calendar_object_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
546
|
-
calendarId: text("calendar_id").notNull(),
|
|
547
|
-
resourceName: text("resource_name").notNull(),
|
|
548
|
-
icalUid: text("ical_uid").notNull(),
|
|
549
|
-
icalData: text("ical_data").notNull(),
|
|
550
|
-
etag: text("etag").notNull(),
|
|
551
|
-
sequence: integer("sequence").notNull().default(0),
|
|
552
|
-
syncSequence: integer("sync_sequence", { mode: "number" }).notNull().default(0),
|
|
553
|
-
summary: text("summary").notNull(),
|
|
554
|
-
dtStart: text("dt_start").notNull(),
|
|
555
|
-
dtEnd: text("dt_end").notNull(),
|
|
556
|
-
allDay: integer("all_day", { mode: "boolean" }).notNull().default(false),
|
|
557
|
-
zoneCertainty: text("zone_certainty").$type().notNull().default("Explicit"),
|
|
558
|
-
status: text("status").$type().notNull().default("Confirmed"),
|
|
559
|
-
transparency: text("transparency").$type().notNull().default("Opaque"),
|
|
560
|
-
hasRecurrence: integer("has_recurrence", { mode: "boolean" }).notNull().default(false),
|
|
561
|
-
expandedThrough: text("expanded_through").notNull().default(""),
|
|
562
|
-
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
563
|
-
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
564
|
-
}, (table) => [
|
|
565
|
-
index("calendar_object_by_sync_sequence").on(table.calendarId, table.syncSequence),
|
|
566
|
-
index("calendar_object_by_uid").on(table.calendarId, table.icalUid),
|
|
567
|
-
index("calendar_object_primary").on(table.calendarId, table.calendarObjectId),
|
|
568
|
-
]);
|
|
569
569
|
export const calendarEventIndexes = sqliteTable("calendar_event_index", {
|
|
570
570
|
calendarId: text("calendar_id").notNull(),
|
|
571
571
|
calendarObjectId: text("calendar_object_id").notNull(),
|
|
@@ -573,6 +573,9 @@ export const calendarEventIndexes = sqliteTable("calendar_event_index", {
|
|
|
573
573
|
startAt: text("start_at").notNull(),
|
|
574
574
|
endAt: text("end_at").notNull(),
|
|
575
575
|
allDay: integer("all_day", { mode: "boolean" }).notNull().default(false),
|
|
576
|
+
summary: text("summary").notNull().default(""),
|
|
577
|
+
status: text("status").$type().notNull().default("Confirmed"),
|
|
578
|
+
transparency: text("transparency").$type().notNull().default("Opaque"),
|
|
576
579
|
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
577
580
|
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
578
581
|
}, (table) => [
|
package/package.json
CHANGED
package/schema.ts
CHANGED
|
@@ -210,6 +210,57 @@ export const organizeJobRequests = sqliteTable(
|
|
|
210
210
|
],
|
|
211
211
|
);
|
|
212
212
|
|
|
213
|
+
export const calendarCollections = sqliteTable(
|
|
214
|
+
"calendar",
|
|
215
|
+
{
|
|
216
|
+
calendarId: text("calendar_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
217
|
+
accountConfigId: text("account_config_id").notNull(),
|
|
218
|
+
urlSegment: text("url_segment").notNull(),
|
|
219
|
+
displayName: text("display_name").notNull(),
|
|
220
|
+
color: text("color").$type<"Cal1" | "Cal2" | "Cal3" | "Cal4" | "Cal5" | "Cal6">().notNull().default("Cal1"),
|
|
221
|
+
componentSet: text("component_set").$type<"VeventOnly">().notNull().default("VeventOnly"),
|
|
222
|
+
source: text("source").$type<"Default" | "UserCreated" | "MailDerived">().notNull().default("UserCreated"),
|
|
223
|
+
timezone: text("timezone").notNull().default(""),
|
|
224
|
+
syncSequence: integer("sync_sequence", { mode: "number" }).notNull().default(0),
|
|
225
|
+
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
226
|
+
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
227
|
+
},
|
|
228
|
+
(table) => [
|
|
229
|
+
index("calendar_by_url_segment").on(table.accountConfigId, table.urlSegment),
|
|
230
|
+
index("calendar_primary").on(table.accountConfigId, table.calendarId),
|
|
231
|
+
],
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
export const calendarObjects = sqliteTable(
|
|
235
|
+
"calendar_object",
|
|
236
|
+
{
|
|
237
|
+
calendarObjectId: text("calendar_object_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
238
|
+
calendarId: text("calendar_id").notNull(),
|
|
239
|
+
resourceName: text("resource_name").notNull(),
|
|
240
|
+
icalUid: text("ical_uid").notNull(),
|
|
241
|
+
icalData: text("ical_data").notNull(),
|
|
242
|
+
etag: text("etag").notNull(),
|
|
243
|
+
sequence: integer("sequence").notNull().default(0),
|
|
244
|
+
syncSequence: integer("sync_sequence", { mode: "number" }).notNull().default(0),
|
|
245
|
+
summary: text("summary").notNull(),
|
|
246
|
+
dtStart: text("dt_start").notNull(),
|
|
247
|
+
dtEnd: text("dt_end").notNull(),
|
|
248
|
+
allDay: integer("all_day", { mode: "boolean" }).notNull().default(false),
|
|
249
|
+
zoneCertainty: text("zone_certainty").$type<"Local" | "Explicit" | "Ambiguous">().notNull().default("Explicit"),
|
|
250
|
+
status: text("status").$type<"Confirmed" | "Tentative" | "Cancelled">().notNull().default("Confirmed"),
|
|
251
|
+
transparency: text("transparency").$type<"Opaque" | "Transparent">().notNull().default("Opaque"),
|
|
252
|
+
hasRecurrence: integer("has_recurrence", { mode: "boolean" }).notNull().default(false),
|
|
253
|
+
expandedThrough: text("expanded_through").notNull().default(""),
|
|
254
|
+
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
255
|
+
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
256
|
+
},
|
|
257
|
+
(table) => [
|
|
258
|
+
index("calendar_object_by_sync_sequence").on(table.calendarId, table.syncSequence),
|
|
259
|
+
index("calendar_object_by_uid").on(table.calendarId, table.icalUid),
|
|
260
|
+
index("calendar_object_primary").on(table.calendarId, table.calendarObjectId),
|
|
261
|
+
],
|
|
262
|
+
);
|
|
263
|
+
|
|
213
264
|
export const threadMessages = sqliteTable(
|
|
214
265
|
"thread_message",
|
|
215
266
|
{
|
|
@@ -681,57 +732,6 @@ export const bodyPartContents = sqliteTable(
|
|
|
681
732
|
],
|
|
682
733
|
);
|
|
683
734
|
|
|
684
|
-
export const calendarCollections = sqliteTable(
|
|
685
|
-
"calendar",
|
|
686
|
-
{
|
|
687
|
-
calendarId: text("calendar_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
688
|
-
accountConfigId: text("account_config_id").notNull(),
|
|
689
|
-
urlSegment: text("url_segment").notNull(),
|
|
690
|
-
displayName: text("display_name").notNull(),
|
|
691
|
-
color: text("color").$type<"Cal1" | "Cal2" | "Cal3" | "Cal4" | "Cal5" | "Cal6">().notNull().default("Cal1"),
|
|
692
|
-
componentSet: text("component_set").$type<"VeventOnly">().notNull().default("VeventOnly"),
|
|
693
|
-
source: text("source").$type<"Default" | "UserCreated" | "MailDerived">().notNull().default("UserCreated"),
|
|
694
|
-
timezone: text("timezone").notNull().default(""),
|
|
695
|
-
syncSequence: integer("sync_sequence", { mode: "number" }).notNull().default(0),
|
|
696
|
-
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
697
|
-
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
698
|
-
},
|
|
699
|
-
(table) => [
|
|
700
|
-
index("calendar_by_url_segment").on(table.accountConfigId, table.urlSegment),
|
|
701
|
-
index("calendar_primary").on(table.accountConfigId, table.calendarId),
|
|
702
|
-
],
|
|
703
|
-
);
|
|
704
|
-
|
|
705
|
-
export const calendarObjects = sqliteTable(
|
|
706
|
-
"calendar_object",
|
|
707
|
-
{
|
|
708
|
-
calendarObjectId: text("calendar_object_id").primaryKey().$defaultFn(() => generateBase36Id()),
|
|
709
|
-
calendarId: text("calendar_id").notNull(),
|
|
710
|
-
resourceName: text("resource_name").notNull(),
|
|
711
|
-
icalUid: text("ical_uid").notNull(),
|
|
712
|
-
icalData: text("ical_data").notNull(),
|
|
713
|
-
etag: text("etag").notNull(),
|
|
714
|
-
sequence: integer("sequence").notNull().default(0),
|
|
715
|
-
syncSequence: integer("sync_sequence", { mode: "number" }).notNull().default(0),
|
|
716
|
-
summary: text("summary").notNull(),
|
|
717
|
-
dtStart: text("dt_start").notNull(),
|
|
718
|
-
dtEnd: text("dt_end").notNull(),
|
|
719
|
-
allDay: integer("all_day", { mode: "boolean" }).notNull().default(false),
|
|
720
|
-
zoneCertainty: text("zone_certainty").$type<"Local" | "Explicit" | "Ambiguous">().notNull().default("Explicit"),
|
|
721
|
-
status: text("status").$type<"Confirmed" | "Tentative" | "Cancelled">().notNull().default("Confirmed"),
|
|
722
|
-
transparency: text("transparency").$type<"Opaque" | "Transparent">().notNull().default("Opaque"),
|
|
723
|
-
hasRecurrence: integer("has_recurrence", { mode: "boolean" }).notNull().default(false),
|
|
724
|
-
expandedThrough: text("expanded_through").notNull().default(""),
|
|
725
|
-
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
726
|
-
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
727
|
-
},
|
|
728
|
-
(table) => [
|
|
729
|
-
index("calendar_object_by_sync_sequence").on(table.calendarId, table.syncSequence),
|
|
730
|
-
index("calendar_object_by_uid").on(table.calendarId, table.icalUid),
|
|
731
|
-
index("calendar_object_primary").on(table.calendarId, table.calendarObjectId),
|
|
732
|
-
],
|
|
733
|
-
);
|
|
734
|
-
|
|
735
735
|
export const calendarEventIndexes = sqliteTable(
|
|
736
736
|
"calendar_event_index",
|
|
737
737
|
{
|
|
@@ -741,6 +741,9 @@ export const calendarEventIndexes = sqliteTable(
|
|
|
741
741
|
startAt: text("start_at").notNull(),
|
|
742
742
|
endAt: text("end_at").notNull(),
|
|
743
743
|
allDay: integer("all_day", { mode: "boolean" }).notNull().default(false),
|
|
744
|
+
summary: text("summary").notNull().default(""),
|
|
745
|
+
status: text("status").$type<"Confirmed" | "Tentative" | "Cancelled">().notNull().default("Confirmed"),
|
|
746
|
+
transparency: text("transparency").$type<"Opaque" | "Transparent">().notNull().default("Opaque"),
|
|
744
747
|
createdAt: integer("created_at", { mode: "number" }).notNull(),
|
|
745
748
|
updatedAt: integer("updated_at", { mode: "number" }).notNull(),
|
|
746
749
|
},
|