Skip to content

Commit

Permalink
Merge pull request #627 from dzcode-io/feat/project-category
Browse files Browse the repository at this point in the history
  • Loading branch information
ZibanPirate authored Dec 29, 2024
2 parents 58ea3c9 + 70b3c8e commit 67a223b
Show file tree
Hide file tree
Showing 55 changed files with 1,255 additions and 59 deletions.
8 changes: 8 additions & 0 deletions api/db/migrations/0001_classy_blindfold.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS "tags" (
"id" text PRIMARY KEY NOT NULL,
"record_imported_at" text DEFAULT CURRENT_TIMESTAMP NOT NULL,
"run_id" text DEFAULT 'initial-run-id' NOT NULL
);
--> statement-breakpoint
ALTER TABLE "contributors" ALTER COLUMN "run_id" DROP DEFAULT;--> statement-breakpoint
ALTER TABLE "projects" ALTER COLUMN "run_id" DROP DEFAULT;
13 changes: 13 additions & 0 deletions api/db/migrations/0002_cooing_thena.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE IF NOT EXISTS "project_tag_relation" (
"project_id" text NOT NULL,
"tag_id" text NOT NULL,
"record_imported_at" text DEFAULT CURRENT_TIMESTAMP NOT NULL,
"run_id" text DEFAULT 'initial-run-id' NOT NULL,
CONSTRAINT "project_tag_relation_pk" PRIMARY KEY("project_id","tag_id")
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "project_tag_relation" ADD CONSTRAINT "project_tag_relation_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
Loading

0 comments on commit 67a223b

Please sign in to comment.