2024-04-03 00:51:12 +00:00
|
|
|
import {
|
|
|
|
pgTable,
|
|
|
|
text,
|
|
|
|
timestamp,
|
|
|
|
json,
|
|
|
|
serial,
|
|
|
|
varchar,
|
|
|
|
} from "drizzle-orm/pg-core";
|
2024-04-02 14:01:35 +00:00
|
|
|
|
2024-04-02 22:02:20 +00:00
|
|
|
export const featuredAdventures = pgTable("featuredAdventures", {
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
name: text("name").notNull(),
|
|
|
|
location: text("location"),
|
|
|
|
});
|
2024-04-02 14:01:35 +00:00
|
|
|
|
2024-04-02 22:02:20 +00:00
|
|
|
export const sharedAdventures = pgTable("sharedAdventures", {
|
|
|
|
id: text("id").primaryKey(),
|
|
|
|
data: json("data").notNull(),
|
|
|
|
});
|
2024-04-03 00:51:12 +00:00
|
|
|
|
|
|
|
export const userTable = pgTable("user", {
|
|
|
|
id: text("id").primaryKey(),
|
|
|
|
username: text("username").notNull(),
|
2024-04-03 22:59:05 +00:00
|
|
|
first_name: text("first_name").notNull(),
|
|
|
|
last_name: text("last_name").notNull(),
|
2024-04-03 00:51:12 +00:00
|
|
|
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(),
|
|
|
|
});
|