Db-Relation Tag
added.
This commit is contained in:
@@ -2,11 +2,14 @@ CREATE TABLE images (
|
||||
id VARCHAR(40) PRIMARY KEY NOT NULL,
|
||||
path VARCHAR(500) NOT NULL,
|
||||
title VARCHAR(200),
|
||||
image_type INTEGER NOT NULL,
|
||||
last_changed TIMESTAMP NOT NULL,
|
||||
published BOOLEAN NOT NULL DEFAULT 'f'
|
||||
);
|
||||
|
||||
INSERT INTO images (id, path, title, last_changed, published) VALUES
|
||||
('8e153cab-7dc9-46c7-9a72-91e56ac174ca', './BlueSquare.jpg', 'Blaues Quadrat', '2020-05-27 13:33:56.747473', false );
|
||||
INSERT INTO images (id, path, title, last_changed, published) VALUES
|
||||
('ea01f5cd-a532-4232-810c-bae977cc4336', './Canon_40D.jpg', 'Canon 40d', '2020-05-27 13:33:56.747473', false );
|
||||
CREATE INDEX image_path_idx ON images (path);
|
||||
|
||||
INSERT INTO images (id, path, title, image_type, last_changed, published) VALUES
|
||||
('8e153cab-7dc9-46c7-9a72-91e56ac174ca', './BlueSquare.jpg', 'Blaues Quadrat', 1, '2020-05-27 13:33:56.747473', false );
|
||||
INSERT INTO images (id, path, title, image_type, last_changed, published) VALUES
|
||||
('ea01f5cd-a532-4232-810c-bae977cc4336', './Canon_40D.jpg', 'Canon 40d', 1, '2020-05-27 13:33:56.747473', false );
|
2
migrations/2020-07-01-172642_tags/down.sql
Normal file
2
migrations/2020-07-01-172642_tags/down.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE IF EXISTS tags;
|
8
migrations/2020-07-01-172642_tags/up.sql
Normal file
8
migrations/2020-07-01-172642_tags/up.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE tags
|
||||
(
|
||||
image_id VARCHAR(40) NOT NULL REFERENCES images (id),
|
||||
tag_type VARCHAR(20) NOT NULL,
|
||||
name VARCHAR(500) NOT NULL,
|
||||
PRIMARY KEY (image_id, name)
|
||||
);
|
Reference in New Issue
Block a user