@remit/drizzle-pg-schema 0.0.6 → 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
@@ -1992,6 +1992,134 @@ export declare const filters: import("drizzle-orm/pg-core").PgTableWithColumns<{
1992
1992
  };
1993
1993
  dialect: "pg";
1994
1994
  }>;
1995
+ export declare const labels: import("drizzle-orm/pg-core").PgTableWithColumns<{
1996
+ name: "label";
1997
+ schema: undefined;
1998
+ columns: {
1999
+ labelId: import("drizzle-orm/pg-core").PgColumn<{
2000
+ name: "label_id";
2001
+ tableName: "label";
2002
+ dataType: "string";
2003
+ columnType: "PgText";
2004
+ data: string;
2005
+ driverParam: string;
2006
+ notNull: true;
2007
+ hasDefault: true;
2008
+ isPrimaryKey: true;
2009
+ isAutoincrement: false;
2010
+ hasRuntimeDefault: true;
2011
+ enumValues: [string, ...string[]];
2012
+ baseColumn: never;
2013
+ identity: undefined;
2014
+ generated: undefined;
2015
+ }, {}, {}>;
2016
+ accountConfigId: import("drizzle-orm/pg-core").PgColumn<{
2017
+ name: "account_config_id";
2018
+ tableName: "label";
2019
+ dataType: "string";
2020
+ columnType: "PgText";
2021
+ data: string;
2022
+ driverParam: string;
2023
+ notNull: true;
2024
+ hasDefault: false;
2025
+ isPrimaryKey: false;
2026
+ isAutoincrement: false;
2027
+ hasRuntimeDefault: false;
2028
+ enumValues: [string, ...string[]];
2029
+ baseColumn: never;
2030
+ identity: undefined;
2031
+ generated: undefined;
2032
+ }, {}, {}>;
2033
+ name: import("drizzle-orm/pg-core").PgColumn<{
2034
+ name: "name";
2035
+ tableName: "label";
2036
+ dataType: "string";
2037
+ columnType: "PgText";
2038
+ data: string;
2039
+ driverParam: string;
2040
+ notNull: true;
2041
+ hasDefault: false;
2042
+ isPrimaryKey: false;
2043
+ isAutoincrement: false;
2044
+ hasRuntimeDefault: false;
2045
+ enumValues: [string, ...string[]];
2046
+ baseColumn: never;
2047
+ identity: undefined;
2048
+ generated: undefined;
2049
+ }, {}, {}>;
2050
+ normalizedName: import("drizzle-orm/pg-core").PgColumn<{
2051
+ name: "normalized_name";
2052
+ tableName: "label";
2053
+ dataType: "string";
2054
+ columnType: "PgText";
2055
+ data: string;
2056
+ driverParam: string;
2057
+ notNull: true;
2058
+ hasDefault: false;
2059
+ isPrimaryKey: false;
2060
+ isAutoincrement: false;
2061
+ hasRuntimeDefault: false;
2062
+ enumValues: [string, ...string[]];
2063
+ baseColumn: never;
2064
+ identity: undefined;
2065
+ generated: undefined;
2066
+ }, {}, {}>;
2067
+ color: import("drizzle-orm/pg-core").PgColumn<{
2068
+ name: "color";
2069
+ tableName: "label";
2070
+ dataType: "string";
2071
+ columnType: "PgText";
2072
+ data: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
2073
+ driverParam: string;
2074
+ notNull: true;
2075
+ hasDefault: true;
2076
+ isPrimaryKey: false;
2077
+ isAutoincrement: false;
2078
+ hasRuntimeDefault: false;
2079
+ enumValues: [string, ...string[]];
2080
+ baseColumn: never;
2081
+ identity: undefined;
2082
+ generated: undefined;
2083
+ }, {}, {
2084
+ $type: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
2085
+ }>;
2086
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
2087
+ name: "created_at";
2088
+ tableName: "label";
2089
+ dataType: "number";
2090
+ columnType: "PgBigInt53";
2091
+ data: number;
2092
+ driverParam: string | number;
2093
+ notNull: true;
2094
+ hasDefault: false;
2095
+ isPrimaryKey: false;
2096
+ isAutoincrement: false;
2097
+ hasRuntimeDefault: false;
2098
+ enumValues: undefined;
2099
+ baseColumn: never;
2100
+ identity: undefined;
2101
+ generated: undefined;
2102
+ }, {}, {}>;
2103
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
2104
+ name: "updated_at";
2105
+ tableName: "label";
2106
+ dataType: "number";
2107
+ columnType: "PgBigInt53";
2108
+ data: number;
2109
+ driverParam: string | number;
2110
+ notNull: true;
2111
+ hasDefault: false;
2112
+ isPrimaryKey: false;
2113
+ isAutoincrement: false;
2114
+ hasRuntimeDefault: false;
2115
+ enumValues: undefined;
2116
+ baseColumn: never;
2117
+ identity: undefined;
2118
+ generated: undefined;
2119
+ }, {}, {}>;
2120
+ };
2121
+ dialect: "pg";
2122
+ }>;
1995
2123
  export declare const organizeJobRequests: import("drizzle-orm/pg-core").PgTableWithColumns<{
1996
2124
  name: "organize_job_request";
1997
2125
  schema: undefined;
@@ -6235,134 +6363,6 @@ export declare const bodyPartContents: import("drizzle-orm/pg-core").PgTableWith
6235
6363
  };
6236
6364
  dialect: "pg";
6237
6365
  }>;
6238
- export declare const labels: import("drizzle-orm/pg-core").PgTableWithColumns<{
6239
- name: "label";
6240
- schema: undefined;
6241
- columns: {
6242
- labelId: import("drizzle-orm/pg-core").PgColumn<{
6243
- name: "label_id";
6244
- tableName: "label";
6245
- dataType: "string";
6246
- columnType: "PgText";
6247
- data: string;
6248
- driverParam: string;
6249
- notNull: true;
6250
- hasDefault: true;
6251
- isPrimaryKey: true;
6252
- isAutoincrement: false;
6253
- hasRuntimeDefault: true;
6254
- enumValues: [string, ...string[]];
6255
- baseColumn: never;
6256
- identity: undefined;
6257
- generated: undefined;
6258
- }, {}, {}>;
6259
- accountConfigId: import("drizzle-orm/pg-core").PgColumn<{
6260
- name: "account_config_id";
6261
- tableName: "label";
6262
- dataType: "string";
6263
- columnType: "PgText";
6264
- data: string;
6265
- driverParam: string;
6266
- notNull: true;
6267
- hasDefault: false;
6268
- isPrimaryKey: false;
6269
- isAutoincrement: false;
6270
- hasRuntimeDefault: false;
6271
- enumValues: [string, ...string[]];
6272
- baseColumn: never;
6273
- identity: undefined;
6274
- generated: undefined;
6275
- }, {}, {}>;
6276
- name: import("drizzle-orm/pg-core").PgColumn<{
6277
- name: "name";
6278
- tableName: "label";
6279
- dataType: "string";
6280
- columnType: "PgText";
6281
- data: string;
6282
- driverParam: string;
6283
- notNull: true;
6284
- hasDefault: false;
6285
- isPrimaryKey: false;
6286
- isAutoincrement: false;
6287
- hasRuntimeDefault: false;
6288
- enumValues: [string, ...string[]];
6289
- baseColumn: never;
6290
- identity: undefined;
6291
- generated: undefined;
6292
- }, {}, {}>;
6293
- normalizedName: import("drizzle-orm/pg-core").PgColumn<{
6294
- name: "normalized_name";
6295
- tableName: "label";
6296
- dataType: "string";
6297
- columnType: "PgText";
6298
- data: string;
6299
- driverParam: string;
6300
- notNull: true;
6301
- hasDefault: false;
6302
- isPrimaryKey: false;
6303
- isAutoincrement: false;
6304
- hasRuntimeDefault: false;
6305
- enumValues: [string, ...string[]];
6306
- baseColumn: never;
6307
- identity: undefined;
6308
- generated: undefined;
6309
- }, {}, {}>;
6310
- color: import("drizzle-orm/pg-core").PgColumn<{
6311
- name: "color";
6312
- tableName: "label";
6313
- dataType: "string";
6314
- columnType: "PgText";
6315
- data: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
6316
- driverParam: string;
6317
- notNull: true;
6318
- hasDefault: true;
6319
- isPrimaryKey: false;
6320
- isAutoincrement: false;
6321
- hasRuntimeDefault: false;
6322
- enumValues: [string, ...string[]];
6323
- baseColumn: never;
6324
- identity: undefined;
6325
- generated: undefined;
6326
- }, {}, {
6327
- $type: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
6328
- }>;
6329
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
6330
- name: "created_at";
6331
- tableName: "label";
6332
- dataType: "number";
6333
- columnType: "PgBigInt53";
6334
- data: number;
6335
- driverParam: string | number;
6336
- notNull: true;
6337
- hasDefault: false;
6338
- isPrimaryKey: false;
6339
- isAutoincrement: false;
6340
- hasRuntimeDefault: false;
6341
- enumValues: undefined;
6342
- baseColumn: never;
6343
- identity: undefined;
6344
- generated: undefined;
6345
- }, {}, {}>;
6346
- updatedAt: import("drizzle-orm/pg-core").PgColumn<{
6347
- name: "updated_at";
6348
- tableName: "label";
6349
- dataType: "number";
6350
- columnType: "PgBigInt53";
6351
- data: number;
6352
- driverParam: string | number;
6353
- notNull: true;
6354
- hasDefault: false;
6355
- isPrimaryKey: false;
6356
- isAutoincrement: false;
6357
- hasRuntimeDefault: false;
6358
- enumValues: undefined;
6359
- baseColumn: never;
6360
- identity: undefined;
6361
- generated: undefined;
6362
- }, {}, {}>;
6363
- };
6364
- dialect: "pg";
6365
- }>;
6366
6366
  export declare const messageLabels: import("drizzle-orm/pg-core").PgTableWithColumns<{
6367
6367
  name: "message_label";
6368
6368
  schema: undefined;
package/dist/schema.js CHANGED
@@ -135,6 +135,18 @@ export const filters = pgTable("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 = pgTable("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: bigint("created_at", { mode: "number" }).notNull(),
145
+ updatedAt: bigint("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 = pgTable("organize_job_request", {
139
151
  organizeJobId: text("organize_job_id").primaryKey().$defaultFn(() => generateBase36Id()),
140
152
  accountConfigId: text("account_config_id").notNull(),
@@ -465,18 +477,6 @@ export const bodyPartContents = pgTable("body_part_content", {
465
477
  }, (table) => [
466
478
  index("body_part_content_by_message_id").on(table.messageId, table.bodyPartContentId),
467
479
  ]);
468
- export const labels = pgTable("label", {
469
- labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
470
- accountConfigId: text("account_config_id").notNull(),
471
- name: text("name").notNull(),
472
- normalizedName: text("normalized_name").notNull(),
473
- color: text("color").$type().notNull().default("Default"),
474
- createdAt: bigint("created_at", { mode: "number" }).notNull(),
475
- updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
476
- }, (table) => [
477
- index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
478
- index("label_primary").on(table.accountConfigId, table.labelId),
479
- ]);
480
480
  export const messageLabels = pgTable("message_label", {
481
481
  messageLabelId: text("message_label_id").primaryKey().$defaultFn(() => generateBase36Id()),
482
482
  messageId: text("message_id").notNull(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/drizzle-pg-schema",
3
- "version": "0.0.6",
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 = pgTable(
166
166
  ],
167
167
  );
168
168
 
169
+ export const labels = pgTable(
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: bigint("created_at", { mode: "number" }).notNull(),
178
+ updatedAt: bigint("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 = pgTable(
170
187
  "organize_job_request",
171
188
  {
@@ -601,23 +618,6 @@ export const bodyPartContents = pgTable(
601
618
  ],
602
619
  );
603
620
 
604
- export const labels = pgTable(
605
- "label",
606
- {
607
- labelId: text("label_id").primaryKey().$defaultFn(() => generateBase36Id()),
608
- accountConfigId: text("account_config_id").notNull(),
609
- name: text("name").notNull(),
610
- normalizedName: text("normalized_name").notNull(),
611
- color: text("color").$type<"Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray">().notNull().default("Default"),
612
- createdAt: bigint("created_at", { mode: "number" }).notNull(),
613
- updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
614
- },
615
- (table) => [
616
- index("label_by_normalized_name").on(table.accountConfigId, table.normalizedName),
617
- index("label_primary").on(table.accountConfigId, table.labelId),
618
- ],
619
- );
620
-
621
621
  export const messageLabels = pgTable(
622
622
  "message_label",
623
623
  {