mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
committing wiht errors wbut better than before, moved some stuff more moving coming,
This commit is contained in:
@@ -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
7
src/db/schema/States.ts
Normal 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 }),
|
||||
});
|
||||
Reference in New Issue
Block a user