mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 23:09:37 +02:00
Added auth!
This commit is contained in:
parent
3fd6d021f7
commit
372db59211
18 changed files with 1887 additions and 20 deletions
|
@ -1,4 +1,11 @@
|
|||
import { pgTable, json, text, serial } from "drizzle-orm/pg-core";
|
||||
import {
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
json,
|
||||
serial,
|
||||
varchar,
|
||||
} from "drizzle-orm/pg-core";
|
||||
|
||||
export const featuredAdventures = pgTable("featuredAdventures", {
|
||||
id: serial("id").primaryKey(),
|
||||
|
@ -10,3 +17,22 @@ export const sharedAdventures = pgTable("sharedAdventures", {
|
|||
id: text("id").primaryKey(),
|
||||
data: json("data").notNull(),
|
||||
});
|
||||
|
||||
export const userTable = pgTable("user", {
|
||||
id: text("id").primaryKey(),
|
||||
username: text("username").notNull(),
|
||||
hashed_password: varchar("hashed_password").notNull(),
|
||||
});
|
||||
|
||||
// export type SelectUser = typeof userTable.$inferSelect;
|
||||
|
||||
export const sessionTable = pgTable("session", {
|
||||
id: text("id").primaryKey(),
|
||||
userId: text("user_id")
|
||||
.notNull()
|
||||
.references(() => userTable.id),
|
||||
expiresAt: timestamp("expires_at", {
|
||||
withTimezone: true,
|
||||
mode: "date",
|
||||
}).notNull(),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue