Work on shares

This commit is contained in:
viktorstrate
2020-02-11 14:32:35 +01:00
parent 5a0f03268d
commit 687b4f4f7f
11 changed files with 221 additions and 178 deletions

View File

@@ -2,11 +2,11 @@ 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,
expire timestamp NULL DEFAULT NULL,
password varchar(256),
album_id int,
photo_id int,
PRIMARY KEY (token_id),
CHECK (album_id IS NOT NULL OR photo_id IS NOT NULL)
PRIMARY KEY (token_id)
-- CHECK (album_id IS NOT NULL OR photo_id IS NOT NULL)
);

View File

@@ -25,6 +25,7 @@ func SetupDatabase() *sql.DB {
queryValues := address.Query()
queryValues.Add("multiStatements", "true")
queryValues.Add("parseTime", "true")
address.RawQuery = queryValues.Encode()