Added combined unique constraints using plant_id and item_id
This commit is contained in:
@@ -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)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user