categorys and titles for images
This commit is contained in:
parent
8abbb13fcc
commit
239c879649
22 changed files with 964 additions and 86 deletions
24
src/dbpatches/01_initial.sqlite
Normal file
24
src/dbpatches/01_initial.sqlite
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
CREATE TABLE categories (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
||||
slug TEXT UNIQUE,
|
||||
title TEXT UNIQUE
|
||||
);
|
||||
|
||||
CREATE TABLE images (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
||||
created TIMESTAMP NOT NULL,
|
||||
|
||||
filename TEXT NOT NULL UNIQUE,
|
||||
filename_original TEXT NOT NULL,
|
||||
title TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE image_x_category (
|
||||
image_id INTEGER NOT NULL,
|
||||
category_id INTEGER NOT NULL,
|
||||
|
||||
FOREIGN KEY(image_id) REFERENCES images(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY(category_id) REFERENCES categories(id) ON DELETE CASCADE
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue