Added combined unique constraints using plant_id and item_id

This commit is contained in:
dhanabalan
2025-04-20 17:01:33 +05:30
parent 283761003b
commit 3d50c67c6d

View File

@@ -51,6 +51,7 @@ return new class extends Migration
updated_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMP, deleted_at TIMESTAMP,
UNIQUE (plant_id, item_id),
FOREIGN KEY (item_id) REFERENCES items (id), FOREIGN KEY (item_id) REFERENCES items (id),
FOREIGN KEY (plant_id) REFERENCES plants (id) FOREIGN KEY (plant_id) REFERENCES plants (id)
); );