mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-31 10:49:37 +02:00
Add featuredAdventures table and related code
This commit is contained in:
parent
c23ea0ce5e
commit
33122894c2
10 changed files with 1936 additions and 39 deletions
8
src/lib/db/db.server.ts
Normal file
8
src/lib/db/db.server.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import postgres from 'postgres';
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
const { DATABASE_URL } = process.env;
|
||||
|
||||
const client = postgres(DATABASE_URL)
|
||||
export const db = drizzle(client, {});
|
9
src/lib/db/schema.ts
Normal file
9
src/lib/db/schema.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { pgTable,serial,text } from "drizzle-orm/pg-core";
|
||||
|
||||
export const featuredAdventures = pgTable("featuredAdventures",{
|
||||
id:serial("id").primaryKey(),
|
||||
name:text("name").notNull(),
|
||||
location:text("location"),
|
||||
})
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue