2025-05-19 14:52:01 +02:00
|
|
|
import { integer, json, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
2025-05-18 13:18:46 +02:00
|
|
|
|
|
|
|
export const users = pgTable("users", {
|
|
|
|
id: text().primaryKey(),
|
|
|
|
age: integer(),
|
|
|
|
username: text().notNull().unique(),
|
|
|
|
passwordHash: text().notNull(),
|
|
|
|
});
|
|
|
|
|
|
|
|
export const sessions = pgTable("sessions", {
|
|
|
|
id: text().primaryKey(),
|
|
|
|
userId: text()
|
|
|
|
.notNull()
|
|
|
|
.references(() => users.id),
|
|
|
|
expiresAt: timestamp({ withTimezone: true, mode: "date" }).notNull(),
|
|
|
|
});
|
2025-05-18 17:21:58 +02:00
|
|
|
|
|
|
|
export const floors = pgTable("floors", {
|
|
|
|
floor: integer().primaryKey(),
|
|
|
|
url: text().notNull(),
|
|
|
|
});
|
2025-05-19 14:52:01 +02:00
|
|
|
|
|
|
|
export const plans = pgTable("plans", {
|
|
|
|
floor: integer().primaryKey(),
|
|
|
|
plan: json().notNull(),
|
|
|
|
});
|