Forgot to commit db deployment scripts

This commit is contained in:
Denis Fedoseev 2017-08-04 22:52:53 +03:00
parent d8a2c09ea0
commit a98302199a
3 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,17 @@
-- Deploy fotostore:images to sqlite
BEGIN;
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
);
COMMIT;

View file

@ -0,0 +1,7 @@
-- Revert fotostore:images from sqlite
BEGIN;
DROP TABLE images;
COMMIT;

View file

@ -0,0 +1,7 @@
-- Verify fotostore:images on sqlite
BEGIN;
select file_id, owner_id, file_name, created_time from images where 0;
ROLLBACK;