@remit/drizzle-sqlite-schema 0.0.5 → 0.0.7

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 CHANGED
@@ -2048,6 +2048,143 @@ export declare const filters: import("drizzle-orm/sqlite-core").SQLiteTableWithC
2048
2048
  };
2049
2049
  dialect: "sqlite";
2050
2050
  }>;
2051
+ export declare const labels: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
2052
+ name: "label";
2053
+ schema: undefined;
2054
+ columns: {
2055
+ labelId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2056
+ name: "label_id";
2057
+ tableName: "label";
2058
+ dataType: "string";
2059
+ columnType: "SQLiteText";
2060
+ data: string;
2061
+ driverParam: string;
2062
+ notNull: true;
2063
+ hasDefault: true;
2064
+ isPrimaryKey: true;
2065
+ isAutoincrement: false;
2066
+ hasRuntimeDefault: true;
2067
+ enumValues: [string, ...string[]];
2068
+ baseColumn: never;
2069
+ identity: undefined;
2070
+ generated: undefined;
2071
+ }, {}, {
2072
+ length: number;
2073
+ }>;
2074
+ accountConfigId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2075
+ name: "account_config_id";
2076
+ tableName: "label";
2077
+ dataType: "string";
2078
+ columnType: "SQLiteText";
2079
+ data: string;
2080
+ driverParam: string;
2081
+ notNull: true;
2082
+ hasDefault: false;
2083
+ isPrimaryKey: false;
2084
+ isAutoincrement: false;
2085
+ hasRuntimeDefault: false;
2086
+ enumValues: [string, ...string[]];
2087
+ baseColumn: never;
2088
+ identity: undefined;
2089
+ generated: undefined;
2090
+ }, {}, {
2091
+ length: number;
2092
+ }>;
2093
+ name: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2094
+ name: "name";
2095
+ tableName: "label";
2096
+ dataType: "string";
2097
+ columnType: "SQLiteText";
2098
+ data: string;
2099
+ driverParam: string;
2100
+ notNull: true;
2101
+ hasDefault: false;
2102
+ isPrimaryKey: false;
2103
+ isAutoincrement: false;
2104
+ hasRuntimeDefault: false;
2105
+ enumValues: [string, ...string[]];
2106
+ baseColumn: never;
2107
+ identity: undefined;
2108
+ generated: undefined;
2109
+ }, {}, {
2110
+ length: number;
2111
+ }>;
2112
+ normalizedName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2113
+ name: "normalized_name";
2114
+ tableName: "label";
2115
+ dataType: "string";
2116
+ columnType: "SQLiteText";
2117
+ data: string;
2118
+ driverParam: string;
2119
+ notNull: true;
2120
+ hasDefault: false;
2121
+ isPrimaryKey: false;
2122
+ isAutoincrement: false;
2123
+ hasRuntimeDefault: false;
2124
+ enumValues: [string, ...string[]];
2125
+ baseColumn: never;
2126
+ identity: undefined;
2127
+ generated: undefined;
2128
+ }, {}, {
2129
+ length: number;
2130
+ }>;
2131
+ color: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2132
+ name: "color";
2133
+ tableName: "label";
2134
+ dataType: "string";
2135
+ columnType: "SQLiteText";
2136
+ data: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
2137
+ driverParam: string;
2138
+ notNull: true;
2139
+ hasDefault: true;
2140
+ isPrimaryKey: false;
2141
+ isAutoincrement: false;
2142
+ hasRuntimeDefault: false;
2143
+ enumValues: [string, ...string[]];
2144
+ baseColumn: never;
2145
+ identity: undefined;
2146
+ generated: undefined;
2147
+ }, {}, {
2148
+ length: number;
2149
+ $type: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
2150
+ }>;
2151
+ createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2152
+ name: "created_at";
2153
+ tableName: "label";
2154
+ dataType: "number";
2155
+ columnType: "SQLiteInteger";
2156
+ data: number;
2157
+ driverParam: number;
2158
+ notNull: true;
2159
+ hasDefault: false;
2160
+ isPrimaryKey: false;
2161
+ isAutoincrement: false;
2162
+ hasRuntimeDefault: false;
2163
+ enumValues: undefined;
2164
+ baseColumn: never;
2165
+ identity: undefined;
2166
+ generated: undefined;
2167
+ }, {}, {}>;
2168
+ updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2169
+ name: "updated_at";
2170
+ tableName: "label";
2171
+ dataType: "number";
2172
+ columnType: "SQLiteInteger";
2173
+ data: number;
2174
+ driverParam: number;
2175
+ notNull: true;
2176
+ hasDefault: false;
2177
+ isPrimaryKey: false;
2178
+ isAutoincrement: false;
2179
+ hasRuntimeDefault: false;
2180
+ enumValues: undefined;
2181
+ baseColumn: never;
2182
+ identity: undefined;
2183
+ generated: undefined;
2184
+ }, {}, {}>;
2185
+ };
2186
+ dialect: "sqlite";
2187
+ }>;
2051
2188
  export declare const organizeJobRequests: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
2052
2189
  name: "organize_job_request";
2053
2190
  schema: undefined;
@@ -2592,6 +2729,25 @@ export declare const threadMessages: import("drizzle-orm/sqlite-core").SQLiteTab
2592
2729
  }, {}, {
2593
2730
  sqliteColumnBuilderBrand: "SQLiteCustomColumnBuilderBrand";
2594
2731
  }>;
2732
+ listId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2733
+ name: "list_id";
2734
+ tableName: "thread_message";
2735
+ dataType: "custom";
2736
+ columnType: "SQLiteCustomColumn";
2737
+ data: string;
2738
+ driverParam: string;
2739
+ notNull: false;
2740
+ hasDefault: false;
2741
+ isPrimaryKey: false;
2742
+ isAutoincrement: false;
2743
+ hasRuntimeDefault: false;
2744
+ enumValues: undefined;
2745
+ baseColumn: never;
2746
+ identity: undefined;
2747
+ generated: undefined;
2748
+ }, {}, {
2749
+ sqliteColumnBuilderBrand: "SQLiteCustomColumnBuilderBrand";
2750
+ }>;
2595
2751
  internalDate: import("drizzle-orm/sqlite-core").SQLiteColumn<{
2596
2752
  name: "internal_date";
2597
2753
  tableName: "thread_message";
@@ -6467,143 +6623,6 @@ export declare const bodyPartContents: import("drizzle-orm/sqlite-core").SQLiteT
6467
6623
  };
6468
6624
  dialect: "sqlite";
6469
6625
  }>;
6470
- export declare const labels: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
6471
- name: "label";
6472
- schema: undefined;
6473
- columns: {
6474
- labelId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
6475
- name: "label_id";
6476
- tableName: "label";
6477
- dataType: "string";
6478
- columnType: "SQLiteText";
6479
- data: string;
6480
- driverParam: string;
6481
- notNull: true;
6482
- hasDefault: true;
6483
- isPrimaryKey: true;
6484
- isAutoincrement: false;
6485
- hasRuntimeDefault: true;
6486
- enumValues: [string, ...string[]];
6487
- baseColumn: never;
6488
- identity: undefined;
6489
- generated: undefined;
6490
- }, {}, {
6491
- length: number;
6492
- }>;
6493
- accountConfigId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
6494
- name: "account_config_id";
6495
- tableName: "label";
6496
- dataType: "string";
6497
- columnType: "SQLiteText";
6498
- data: string;
6499
- driverParam: string;
6500
- notNull: true;
6501
- hasDefault: false;
6502
- isPrimaryKey: false;
6503
- isAutoincrement: false;
6504
- hasRuntimeDefault: false;
6505
- enumValues: [string, ...string[]];
6506
- baseColumn: never;
6507
- identity: undefined;
6508
- generated: undefined;
6509
- }, {}, {
6510
- length: number;
6511
- }>;
6512
- name: import("drizzle-orm/sqlite-core").SQLiteColumn<{
6513
- name: "name";
6514
- tableName: "label";
6515
- dataType: "string";
6516
- columnType: "SQLiteText";
6517
- data: string;
6518
- driverParam: string;
6519
- notNull: true;
6520
- hasDefault: false;
6521
- isPrimaryKey: false;
6522
- isAutoincrement: false;
6523
- hasRuntimeDefault: false;
6524
- enumValues: [string, ...string[]];
6525
- baseColumn: never;
6526
- identity: undefined;
6527
- generated: undefined;
6528
- }, {}, {
6529
- length: number;
6530
- }>;
6531
- normalizedName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
6532
- name: "normalized_name";
6533
- tableName: "label";
6534
- dataType: "string";
6535
- columnType: "SQLiteText";
6536
- data: string;
6537
- driverParam: string;
6538
- notNull: true;
6539
- hasDefault: false;
6540
- isPrimaryKey: false;
6541
- isAutoincrement: false;
6542
- hasRuntimeDefault: false;
6543
- enumValues: [string, ...string[]];
6544
- baseColumn: never;
6545
- identity: undefined;
6546
- generated: undefined;
6547
- }, {}, {
6548
- length: number;
6549
- }>;
6550
- color: import("drizzle-orm/sqlite-core").SQLiteColumn<{
6551
- name: "color";
6552
- tableName: "label";
6553
- dataType: "string";
6554
- columnType: "SQLiteText";
6555
- data: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
6556
- driverParam: string;
6557
- notNull: true;
6558
- hasDefault: true;
6559
- isPrimaryKey: false;
6560
- isAutoincrement: false;
6561
- hasRuntimeDefault: false;
6562
- enumValues: [string, ...string[]];
6563
- baseColumn: never;
6564
- identity: undefined;
6565
- generated: undefined;
6566
- }, {}, {
6567
- length: number;
6568
- $type: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
6569
- }>;
6570
- createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
6571
- name: "created_at";
6572
- tableName: "label";
6573
- dataType: "number";
6574
- columnType: "SQLiteInteger";
6575
- data: number;
6576
- driverParam: number;
6577
- notNull: true;
6578
- hasDefault: false;
6579
- isPrimaryKey: false;
6580
- isAutoincrement: false;
6581
- hasRuntimeDefault: false;
6582
- enumValues: undefined;
6583
- baseColumn: never;
6584
- identity: undefined;
6585
- generated: undefined;
6586
- }, {}, {}>;
6587
- updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
6588
- name: "updated_at";
6589
- tableName: "label";
6590
- dataType: "number";
6591
- columnType: "SQLiteInteger";
6592
- data: number;
6593
- driverParam: number;
6594
- notNull: true;
6595
- hasDefault: false;
6596
- isPrimaryKey: false;
6597
- isAutoincrement: false;
6598
- hasRuntimeDefault: false;
6599
- enumValues: undefined;
6600
- baseColumn: never;
6601
- identity: undefined;
6602
- generated: undefined;
6603
- }, {}, {}>;
6604
- };
6605
- dialect: "sqlite";
6606
- }>;
6607
6626
  export declare const messageLabels: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
6608
6627
  name: "message_label";
6609
6628
  schema: undefined;
package/dist/schema.js CHANGED
@@ -135,6 +135,18 @@ export const filters = sqliteTable("filter", {
135
135
  index("filter_by_account_and_state").on(table.accountConfigId, table.state, table.filterId),
136
136
  index("filter_primary").on(table.accountConfigId, table.filterId),
137
137
  ]);
138
+ export const labels = sqliteTable("label", {
139
+ labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
140
+ accountConfigId: text("account_config_id").notNull(),
141
+ name: text("name").notNull(),
142
+ normalizedName: text("normalized_name").notNull(),
143
+ color: text("color").$type().notNull().default("Default"),
144
+ createdAt: integer("created_at", { mode: "number" }).notNull(),
145
+ updatedAt: integer("updated_at", { mode: "number" }).notNull(),
146
+ }, (table) => [
147
+ index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
148
+ index("label_primary").on(table.accountConfigId, table.labelId),
149
+ ]);
138
150
  export const organizeJobRequests = sqliteTable("organize_job_request", {
139
151
  organizeJobId: text("organize_job_id").primaryKey().$defaultFn(() => generateBase36Id()),
140
152
  accountConfigId: text("account_config_id").notNull(),
@@ -169,6 +181,7 @@ export const threadMessages = sqliteTable("thread_message", {
169
181
  fromEmail: nullableText("from_email"),
170
182
  fromName: nullableText("from_name"),
171
183
  subject: nullableText("subject"),
184
+ listId: nullableText("list_id"),
172
185
  internalDate: integer("internal_date", { mode: "number" }).notNull(),
173
186
  sentDate: integer("sent_date", { mode: "number" }).notNull(),
174
187
  isRead: integer("is_read", { mode: "boolean" }).notNull(),
@@ -464,18 +477,6 @@ export const bodyPartContents = sqliteTable("body_part_content", {
464
477
  }, (table) => [
465
478
  index("body_part_content_by_message_id").on(table.messageId, table.bodyPartContentId),
466
479
  ]);
467
- export const labels = sqliteTable("label", {
468
- labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
469
- accountConfigId: text("account_config_id").notNull(),
470
- name: text("name").notNull(),
471
- normalizedName: text("normalized_name").notNull(),
472
- color: text("color").$type().notNull().default("Default"),
473
- createdAt: integer("created_at", { mode: "number" }).notNull(),
474
- updatedAt: integer("updated_at", { mode: "number" }).notNull(),
475
- }, (table) => [
476
- index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
477
- index("label_primary").on(table.accountConfigId, table.labelId),
478
- ]);
479
480
  export const messageLabels = sqliteTable("message_label", {
480
481
  messageLabelId: text("message_label_id").primaryKey().$defaultFn(() => generateBase36Id()),
481
482
  messageId: text("message_id").notNull(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/drizzle-sqlite-schema",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/schema.ts CHANGED
@@ -166,6 +166,23 @@ export const filters = sqliteTable(
166
166
  ],
167
167
  );
168
168
 
169
+ export const labels = sqliteTable(
170
+ "label",
171
+ {
172
+ labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
173
+ accountConfigId: text("account_config_id").notNull(),
174
+ name: text("name").notNull(),
175
+ normalizedName: text("normalized_name").notNull(),
176
+ color: text("color").$type<"Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray">().notNull().default("Default"),
177
+ createdAt: integer("created_at", { mode: "number" }).notNull(),
178
+ updatedAt: integer("updated_at", { mode: "number" }).notNull(),
179
+ },
180
+ (table) => [
181
+ index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
182
+ index("label_primary").on(table.accountConfigId, table.labelId),
183
+ ],
184
+ );
185
+
169
186
  export const organizeJobRequests = sqliteTable(
170
187
  "organize_job_request",
171
188
  {
@@ -207,6 +224,7 @@ export const threadMessages = sqliteTable(
207
224
  fromEmail: nullableText("from_email"),
208
225
  fromName: nullableText("from_name"),
209
226
  subject: nullableText("subject"),
227
+ listId: nullableText("list_id"),
210
228
  internalDate: integer("internal_date", { mode: "number" }).notNull(),
211
229
  sentDate: integer("sent_date", { mode: "number" }).notNull(),
212
230
  isRead: integer("is_read", { mode: "boolean" }).notNull(),
@@ -600,23 +618,6 @@ export const bodyPartContents = sqliteTable(
600
618
  ],
601
619
  );
602
620
 
603
- export const labels = sqliteTable(
604
- "label",
605
- {
606
- labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
607
- accountConfigId: text("account_config_id").notNull(),
608
- name: text("name").notNull(),
609
- normalizedName: text("normalized_name").notNull(),
610
- color: text("color").$type<"Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray">().notNull().default("Default"),
611
- createdAt: integer("created_at", { mode: "number" }).notNull(),
612
- updatedAt: integer("updated_at", { mode: "number" }).notNull(),
613
- },
614
- (table) => [
615
- index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
616
- index("label_primary").on(table.accountConfigId, table.labelId),
617
- ],
618
- );
619
-
620
621
  export const messageLabels = sqliteTable(
621
622
  "message_label",
622
623
  {