diff --git a/dist/lib/database.d.ts b/dist/lib/database.d.ts index 138a606..6d89cb6 100644 --- a/dist/lib/database.d.ts +++ b/dist/lib/database.d.ts @@ -162,7 +162,7 @@ export default function initializeDatabase({ connectionUri, }: { columnType: "PgArray"; data: string[]; driverParam: string | string[]; - notNull: false; + notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: import("drizzle-orm").Column<{ @@ -185,7 +185,7 @@ export default function initializeDatabase({ connectionUri, }: { columnType: "PgTimestamp"; data: Date; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; @@ -197,7 +197,7 @@ export default function initializeDatabase({ connectionUri, }: { columnType: "PgTimestamp"; data: Date; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; @@ -252,7 +252,7 @@ export default function initializeDatabase({ connectionUri, }: { columnType: "PgText"; data: string; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; @@ -264,7 +264,7 @@ export default function initializeDatabase({ connectionUri, }: { columnType: "PgText"; data: string; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; @@ -276,7 +276,7 @@ export default function initializeDatabase({ connectionUri, }: { columnType: "PgTimestamp"; data: Date; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; @@ -288,7 +288,7 @@ export default function initializeDatabase({ connectionUri, }: { columnType: "PgTimestamp"; data: Date; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; diff --git a/dist/lib/schema.d.ts b/dist/lib/schema.d.ts index f0b05ae..8fd059b 100644 --- a/dist/lib/schema.d.ts +++ b/dist/lib/schema.d.ts @@ -45,7 +45,7 @@ export declare const players: import("drizzle-orm/pg-core").PgTableWithColumns<{ columnType: "PgText"; data: string; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; @@ -57,7 +57,7 @@ export declare const players: import("drizzle-orm/pg-core").PgTableWithColumns<{ columnType: "PgText"; data: string; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; @@ -69,7 +69,7 @@ export declare const players: import("drizzle-orm/pg-core").PgTableWithColumns<{ columnType: "PgTimestamp"; data: Date; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; @@ -81,7 +81,7 @@ export declare const players: import("drizzle-orm/pg-core").PgTableWithColumns<{ columnType: "PgTimestamp"; data: Date; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; @@ -244,7 +244,7 @@ export declare const cosmetics: import("drizzle-orm/pg-core").PgTableWithColumns columnType: "PgArray"; data: string[]; driverParam: string | string[]; - notNull: false; + notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: import("drizzle-orm").Column<{ @@ -267,7 +267,7 @@ export declare const cosmetics: import("drizzle-orm/pg-core").PgTableWithColumns columnType: "PgTimestamp"; data: Date; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; @@ -279,7 +279,7 @@ export declare const cosmetics: import("drizzle-orm/pg-core").PgTableWithColumns columnType: "PgTimestamp"; data: Date; driverParam: string; - notNull: false; + notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; diff --git a/dist/lib/schema.js b/dist/lib/schema.js index 587e27f..57a93f5 100644 --- a/dist/lib/schema.js +++ b/dist/lib/schema.js @@ -4,10 +4,12 @@ export const players = pgTable("players", { uuid: text("uuid").primaryKey().notNull(), username: text("username").notNull(), rank: text("rank").notNull(), - equipped_avatar_id: text("equipped_avatar_id").default("default"), - equipped_avatar_name: text("equipped_avatar_name").default("Default"), - created_at: timestamp("created_at").defaultNow(), - updated_at: timestamp("updated_at").defaultNow(), + equipped_avatar_id: text("equipped_avatar_id").default("default").notNull(), + equipped_avatar_name: text("equipped_avatar_name") + .default("Default") + .notNull(), + created_at: timestamp("created_at").defaultNow().notNull(), + updated_at: timestamp("updated_at").defaultNow().notNull(), }); export const cosmetics = pgTable("cosmetics", { id: text("id").primaryKey().notNull(), @@ -24,8 +26,9 @@ export const cosmetics = pgTable("cosmetics", { price: integer("price").notNull(), manual_tags: text("manual_tags") .array() - .default(sql `ARRAY[]::text[]`), - row_created: timestamp("row_created").defaultNow(), - row_updated: timestamp("row_updated").defaultNow(), + .default(sql `ARRAY[]::text[]`) + .notNull(), + row_created: timestamp("row_created").defaultNow().notNull(), + row_updated: timestamp("row_updated").defaultNow().notNull(), }); //# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/dist/lib/schema.js.map b/dist/lib/schema.js.map index f399413..4965700 100644 --- a/dist/lib/schema.js.map +++ b/dist/lib/schema.js.map @@ -1 +1 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE;IACxC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE;IACzC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;IACpC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,kBAAkB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACjE,oBAAoB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACrE,UAAU,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,UAAU,EAAE;IAChD,UAAU,EAAE,SAAS,CAAC,YAAY,CAAC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AI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;IAChC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACxC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;IAClC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;IACjC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;SAC7B,KAAK,EAAE;SACP,OAAO,CAAC,GAAG,CAAA,iBAAiB,CAAC;SAC7B,OAAO,EAAE;IACZ,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE;IAC5D,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE;CAC7D,CAAC,CAAC"} \ No newline at end of file diff --git a/src/lib/schema.ts b/src/lib/schema.ts index 56e899a..5aca596 100644 --- a/src/lib/schema.ts +++ b/src/lib/schema.ts @@ -12,10 +12,12 @@ export const players = pgTable("players", { uuid: text("uuid").primaryKey().notNull(), username: text("username").notNull(), rank: text("rank").notNull(), - equipped_avatar_id: text("equipped_avatar_id").default("default"), - equipped_avatar_name: text("equipped_avatar_name").default("Default"), - created_at: timestamp("created_at").defaultNow(), - updated_at: timestamp("updated_at").defaultNow(), + equipped_avatar_id: text("equipped_avatar_id").default("default").notNull(), + equipped_avatar_name: text("equipped_avatar_name") + .default("Default") + .notNull(), + created_at: timestamp("created_at").defaultNow().notNull(), + updated_at: timestamp("updated_at").defaultNow().notNull(), }); export const cosmetics = pgTable("cosmetics", { @@ -33,7 +35,8 @@ export const cosmetics = pgTable("cosmetics", { price: integer("price").notNull(), manual_tags: text("manual_tags") .array() - .default(sql`ARRAY[]::text[]`), - row_created: timestamp("row_created").defaultNow(), - row_updated: timestamp("row_updated").defaultNow(), + .default(sql`ARRAY[]::text[]`) + .notNull(), + row_created: timestamp("row_created").defaultNow().notNull(), + row_updated: timestamp("row_updated").defaultNow().notNull(), });