1
Fork 0
photoview/api/database/migrations/004_shares.up.sql

13 lines
302 B
MySQL
Raw Normal View History

2020-02-09 21:25:33 +01:00
CREATE TABLE IF NOT EXISTS share_token (
token_id int AUTO_INCREMENT,
value char(24) NOT NULL UNIQUE,
owner_id int NOT NULL,
expire timestamp,
password varchar(256) NOT NULL,
album_id int,
photo_id int,
PRIMARY KEY (token_id),
CHECK (album_id IS NOT NULL OR photo_id IS NOT NULL)
);