feat(routing): routing_rules schema + types — M4-001/002/003 (#315)
Some checks failed
ci/woodpecker/push/ci Pipeline failed
Some checks failed
ci/woodpecker/push/ci Pipeline failed
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #315.
This commit is contained in:
17
packages/db/drizzle/0004_bumpy_miracleman.sql
Normal file
17
packages/db/drizzle/0004_bumpy_miracleman.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE "routing_rules" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"priority" integer NOT NULL,
|
||||
"scope" text DEFAULT 'system' NOT NULL,
|
||||
"user_id" text,
|
||||
"conditions" jsonb NOT NULL,
|
||||
"action" jsonb NOT NULL,
|
||||
"enabled" boolean DEFAULT true NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "routing_rules" ADD CONSTRAINT "routing_rules_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
CREATE INDEX "routing_rules_scope_priority_idx" ON "routing_rules" USING btree ("scope","priority");--> statement-breakpoint
|
||||
CREATE INDEX "routing_rules_user_id_idx" ON "routing_rules" USING btree ("user_id");--> statement-breakpoint
|
||||
CREATE INDEX "routing_rules_enabled_idx" ON "routing_rules" USING btree ("enabled");
|
||||
Reference in New Issue
Block a user