10 lines
267 B
MySQL
10 lines
267 B
MySQL
|
CREATE TABLE cameras (
|
||
|
id SERIAL PRIMARY KEY,
|
||
|
manufacturer VARCHAR NOT NULL,
|
||
|
model VARCHAR NOT NULL
|
||
|
);
|
||
|
|
||
|
CREATE UNIQUE INDEX cameras_idx ON cameras (manufacturer, model);
|
||
|
|
||
|
ALTER TABLE photos ADD COLUMN camera_id INTEGER REFERENCES cameras (id);
|