Import Fun Completed and Sticker Master
This commit is contained in:
@@ -14,8 +14,6 @@ return new class extends Migration
|
||||
CREATE TABLE items (
|
||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||
|
||||
line_id BIGINT NOT NULL,
|
||||
block_id BIGINT NOT NULL,
|
||||
plant_id BIGINT NOT NULL,
|
||||
|
||||
code TEXT NOT NULL CHECK (LENGTH(code) >= 6),
|
||||
@@ -27,9 +25,7 @@ return new class extends Migration
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
deleted_at TIMESTAMP,
|
||||
|
||||
UNIQUE (code, line_id, block_id, plant_id),
|
||||
FOREIGN KEY (line_id) REFERENCES lines (id),
|
||||
FOREIGN KEY (block_id) REFERENCES blocks (id),
|
||||
UNIQUE (code, plant_id),
|
||||
FOREIGN KEY (plant_id) REFERENCES plants (id)
|
||||
);
|
||||
SQL;
|
||||
|
||||
Reference in New Issue
Block a user