-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds extention for orgs vs daos, colors
- Loading branch information
Showing
8 changed files
with
5,219 additions
and
12 deletions.
There are no files selected for viewing
Binary file not shown.
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,34 @@ | ||
CREATE TABLE IF NOT EXISTS "organizations" ( | ||
"organization_id" bigserial PRIMARY KEY NOT NULL, | ||
"name" text NOT NULL, | ||
"slug" varchar, | ||
"url" varchar, | ||
"description" text, | ||
"image_url" varchar, | ||
"creator_acct" varchar(44), | ||
"admin_accts" jsonb, | ||
"is_hide" boolean, | ||
"socials" jsonb, | ||
"created_at" timestamp with time zone DEFAULT now() NOT NULL, | ||
CONSTRAINT "organizations_name_unique" UNIQUE("name"), | ||
CONSTRAINT "organizations_slug_unique" UNIQUE("slug"), | ||
CONSTRAINT "organizations_url_unique" UNIQUE("url"), | ||
CONSTRAINT "id_name_url" UNIQUE("organization_id","url","name") | ||
); | ||
--> statement-breakpoint | ||
ALTER TABLE "dao_details" ADD COLUMN "organization_id" bigint;--> statement-breakpoint | ||
ALTER TABLE "daos" ADD COLUMN "is_active" boolean DEFAULT false NOT NULL;--> statement-breakpoint | ||
ALTER TABLE "daos" ADD COLUMN "is_primary" boolean DEFAULT false NOT NULL;--> statement-breakpoint | ||
ALTER TABLE "daos" ADD COLUMN "organization_id" bigint;--> statement-breakpoint | ||
ALTER TABLE "daos" ADD COLUMN "colors" jsonb;--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "dao_details" ADD CONSTRAINT "dao_details_organization_id_organizations_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("organization_id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "daos" ADD CONSTRAINT "daos_organization_id_organizations_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("organization_id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
Oops, something went wrong.