adding term examples table

This commit is contained in:
lila 2026-04-20 18:27:32 +02:00
parent e718d188d5
commit 0ac2cef6e1
4 changed files with 1228 additions and 0 deletions

View file

@ -0,0 +1,12 @@
CREATE TABLE "term_examples" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"term_id" uuid NOT NULL,
"language_code" varchar(10) NOT NULL,
"text" text NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "unique_term_example" UNIQUE("term_id","language_code","text"),
CONSTRAINT "language_code_check" CHECK ("term_examples"."language_code" IN ('en', 'it', 'de', 'fr', 'es'))
);
--> statement-breakpoint
ALTER TABLE "term_examples" ADD CONSTRAINT "term_examples_term_id_terms_id_fk" FOREIGN KEY ("term_id") REFERENCES "public"."terms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "idx_term_examples_term_id" ON "term_examples" USING btree ("term_id","language_code");

File diff suppressed because it is too large Load diff

View file

@ -57,6 +57,13 @@
"when": 1776665111607,
"tag": "0007_nosy_leper_queen",
"breakpoints": true
},
{
"idx": 8,
"version": "7",
"when": 1776695279870,
"tag": "0008_far_energizer",
"breakpoints": true
}
]
}