-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update schema to deal with >int firehose seq
- Loading branch information
Showing
17 changed files
with
214 additions
and
1,064 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import type { Config } from 'drizzle-kit' | ||
|
||
export default { | ||
dialect: 'postgresql', | ||
schema: './src/db/schema.ts', | ||
out: './drizzle', | ||
} satisfies Config |
This file was deleted.
Oops, something went wrong.
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 "label_actions" ( | ||
"id" bigserial PRIMARY KEY NOT NULL, | ||
"label" text NOT NULL, | ||
"action" text NOT NULL, | ||
"did" text NOT NULL, | ||
"comment" text, | ||
"unixtimescheduled" bigint DEFAULT 0 | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "listItems" ( | ||
"id" bigserial NOT NULL, | ||
"did" text NOT NULL, | ||
"listURLId" bigint NOT NULL, | ||
"listItemURL" text, | ||
"unixtimeDeleted" bigint, | ||
CONSTRAINT "listItems_did_listURLId_pk" PRIMARY KEY("did","listURLId"), | ||
CONSTRAINT "listItems_id_unique" UNIQUE("id") | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "lists" ( | ||
"id" bigserial PRIMARY KEY NOT NULL, | ||
"label" text NOT NULL, | ||
"listURL" text NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "subscription_status" ( | ||
"id" bigserial PRIMARY KEY NOT NULL, | ||
"last_sequence" bigint DEFAULT -1 NOT NULL | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "listItems" ADD CONSTRAINT "listItems_listURLId_lists_id_fk" FOREIGN KEY ("listURLId") REFERENCES "public"."lists"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
CREATE INDEX IF NOT EXISTS "time_idx" ON "label_actions" USING btree ("unixtimescheduled");--> statement-breakpoint | ||
CREATE INDEX IF NOT EXISTS "did_idx" ON "listItems" USING btree ("did");--> statement-breakpoint | ||
CREATE INDEX IF NOT EXISTS "id_idx" ON "listItems" USING btree ("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 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
Oops, something went wrong.