modeling database

This commit is contained in:
2024-11-19 15:21:30 -05:00
parent c3643915ce
commit c2360fddcd
8 changed files with 61 additions and 2 deletions

View File

@@ -3,9 +3,12 @@ import { sql } from "drizzle-orm";
import { timestamps } from "./columns.helpers";
export const accounts = pgTable("bal_accounts", {
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "accountsid_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "accounts_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
first_name: varchar({ length: 40 }),
last_name: varchar({ length: 40 }),
email: varchar({length: 100}),
username: varchar({length:50}).notNull().unique(),
password_hash: varchar({length:255}).notNull().unique(),
...timestamps
})