sql: forbid same location for part
This commit is contained in:
parent
519759e185
commit
de89dc9b4a
|
@ -134,5 +134,6 @@ CREATE TABLE IF NOT EXISTS inventory (
|
||||||
location INTEGER,
|
location INTEGER,
|
||||||
quantity INTEGER NOT NULL,
|
quantity INTEGER NOT NULL,
|
||||||
FOREIGN KEY (part) REFERENCES part (id),
|
FOREIGN KEY (part) REFERENCES part (id),
|
||||||
FOREIGN KEY (location) REFERENCES location (id)
|
FOREIGN KEY (location) REFERENCES location (id),
|
||||||
|
UNIQUE (part, location)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue