Field original_filename was added to database

This commit is contained in:
Denis Fedoseev 2017-08-02 07:46:54 +03:00
parent 8b70364c14
commit 5d4a0fd63f
5 changed files with 40 additions and 13 deletions

View file

@ -12,4 +12,5 @@
width: 32px; width: 32px;
height: 32px; height: 32px;
overflow: hidden; overflow: hidden;
cursor: pointer;
} }

View file

@ -2,16 +2,6 @@
BEGIN; BEGIN;
CREATE TABLE images ( ALTER TABLE images ADD COLUMN original_filename TEXT NOT NULL DEFAULT "Unknown";
file_id INTEGER PRIMARY KEY AUTOINCREMENT,
owner_id INTEGER NOT NULL,
file_name TEXT NOT NULL,
created_time DATETIME NOT NULL
DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (
owner_id
)
REFERENCES users (user_id) ON DELETE CASCADE
);
COMMIT; COMMIT;

View file

@ -1,7 +1,40 @@
-- Revert fotostore:images from sqlite -- Deploy fotostore:images to sqlite
BEGIN; BEGIN;
PRAGMA foreign_keys = 0;
CREATE TABLE images_rever_temp_table AS SELECT *
FROM images;
DROP TABLE images; DROP TABLE images;
CREATE TABLE images (
file_id INTEGER PRIMARY KEY AUTOINCREMENT,
owner_id INTEGER NOT NULL,
file_name TEXT NOT NULL,
created_time DATETIME NOT NULL
DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (
owner_id
)
REFERENCES users (user_id) ON DELETE CASCADE
);
INSERT INTO images (
file_id,
owner_id,
file_name,
created_time
)
SELECT file_id,
owner_id,
file_name,
created_time
FROM images_rever_temp_table;
DROP TABLE images_rever_temp_table;
PRAGMA foreign_keys = 1;
COMMIT; COMMIT;

View file

@ -8,3 +8,6 @@ albums 2017-07-22T08:50:11Z Denis Fedoseev <denis.fedoseev@gmail.com> # Albums d
user_images [users images] 2017-07-22T09:16:20Z Denis Fedoseev <denis.fedoseev@gmail.com> # +user_images table user_images [users images] 2017-07-22T09:16:20Z Denis Fedoseev <denis.fedoseev@gmail.com> # +user_images table
album_images [images albums] 2017-07-22T09:21:13Z Denis Fedoseev <denis.fedoseev@gmail.com> # +images to album mapping album_images [images albums] 2017-07-22T09:21:13Z Denis Fedoseev <denis.fedoseev@gmail.com> # +images to album mapping
user_albums [users albums] 2017-07-22T09:47:48Z Denis Fedoseev <denis.fedoseev@gmail.com> # Albums to users mapping user_albums [users albums] 2017-07-22T09:47:48Z Denis Fedoseev <denis.fedoseev@gmail.com> # Albums to users mapping
@v1.0.0 2017-08-02T03:46:51Z Denis Fedoseev <denis.fedoseev@gmail.com> # Tag v1.0.0.
images [images@v1.0.0] 2017-08-02T03:55:08Z Denis Fedoseev <denis.fedoseev@gmail.com> # Adds images.original_filename.
@v1.1.0 2017-08-02T04:46:42Z Denis Fedoseev <denis.fedoseev@gmail.com> # Tag v1.1.0.

View file

@ -2,6 +2,6 @@
BEGIN; BEGIN;
select file_id, owner_id, file_name, created_time from images where 0; select file_id, owner_id, file_name, original_filename, created_time from images where 0;
ROLLBACK; ROLLBACK;