-
-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
278ce97
commit 24dc662
Showing
36 changed files
with
676 additions
and
1,640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
import { connect } from '@planetscale/database' | ||
import { drizzle } from 'drizzle-orm/planetscale-serverless' | ||
import { Pool } from '@neondatabase/serverless' | ||
import { drizzle } from 'drizzle-orm/neon-serverless' | ||
|
||
import { env } from '~/env.mjs' | ||
|
||
// create the connection | ||
const connection = connect({ | ||
host: env.DATABASE_HOST, | ||
username: env.DATABASE_USERNAME, | ||
password: env.DATABASE_PASSWORD, | ||
}) | ||
|
||
export const db = drizzle(connection) | ||
const pool = new Pool({ connectionString: env.DATABASE_URL }) | ||
export const db = drizzle(pool) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
CREATE TABLE IF NOT EXISTS "comments" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"user_id" varchar(200) NOT NULL, | ||
"user_info" json, | ||
"post_id" varchar(100) NOT NULL, | ||
"parent_id" integer, | ||
"body" json, | ||
"created_at" timestamp DEFAULT now(), | ||
"updated_at" timestamp DEFAULT now() | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "guestbook" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"user_id" varchar(200) NOT NULL, | ||
"user_info" json, | ||
"message" text NOT NULL, | ||
"created_at" timestamp DEFAULT now(), | ||
"updated_at" timestamp DEFAULT now() | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "newsletters" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"subject" varchar(200), | ||
"body" text, | ||
"sent_at" timestamp, | ||
"created_at" timestamp DEFAULT now(), | ||
"updated_at" timestamp DEFAULT now() | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "subscribers" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"email" varchar(120), | ||
"token" varchar(50), | ||
"subscribed_at" timestamp, | ||
"unsubscribed_at" timestamp, | ||
"updated_at" timestamp DEFAULT now() | ||
); | ||
--> statement-breakpoint | ||
CREATE INDEX IF NOT EXISTS "post_idx" ON "comments" ("post_id"); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.