committing wiht errors wbut better than before, moved some stuff more moving coming,

This commit is contained in:
2024-11-25 16:51:47 -05:00
parent 4c37b9b248
commit 0dfd533b71
19 changed files with 537 additions and 20 deletions

View File

@@ -3,11 +3,12 @@ import { drizzle } from 'drizzle-orm/node-postgres';
import { Pool } from 'pg';
import { sql } from 'drizzle-orm';
// db/index.ts
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
});
export const db = drizzle(pool);
export const db = drizzle(pool, {logger : true});

7
src/db/schema/States.ts Normal file
View File

@@ -0,0 +1,7 @@
import { integer, varchar, pgTable } from "drizzle-orm/pg-core";
export const states = pgTable("states", {
id: integer().primaryKey().generatedByDefaultAsIdentity({ name: "states_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
state: varchar({ length: 50 }),
abbreviation: varchar({ length: 50 }),
});