album/migrations/20160808022325_create_cameras_table/up.sql
Rasmus Kaj 6ed42c0be7 Add camera support.
Store and show which camera each picture was taken with (if present in
exif data).
2016-08-09 01:41:46 +02:00

10 lines
267 B
SQL

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);