first
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE product_media (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
product_id UUID NOT NULL REFERENCES products(id) ON DELETE CASCADE,
|
||||
media_id UUID NOT NULL REFERENCES media(id) ON DELETE CASCADE,
|
||||
position INT NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
UNIQUE (product_id, media_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_product_media_product_id ON product_media(product_id);
|
||||
Reference in New Issue
Block a user