From 0e8285a7e455e1ba4337c232f4b9fd69acf2c9b1 Mon Sep 17 00:00:00 2001 From: azivner Date: Sun, 7 Jan 2018 10:35:24 -0500 Subject: [PATCH] updated schema with image tables --- db/schema.sql | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/db/schema.sql b/db/schema.sql index 937733e4c..6f0042cee 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -83,3 +83,28 @@ CREATE INDEX `IDX_notes_history_note_date_modified_from` ON `notes_history` ( CREATE INDEX `IDX_notes_history_note_date_modified_to` ON `notes_history` ( `date_modified_to` ); +CREATE TABLE images +( + image_id TEXT PRIMARY KEY NOT NULL, + format TEXT NOT NULL, + checksum TEXT NOT NULL, + name TEXT NOT NULL, + data BLOB, + is_deleted INT NOT NULL DEFAULT 0, + date_modified TEXT NOT NULL, + date_created TEXT NOT NULL +); + +CREATE TABLE notes_image +( + note_image_id TEXT PRIMARY KEY NOT NULL, + note_id TEXT NOT NULL, + image_id TEXT NOT NULL, + is_deleted INT NOT NULL DEFAULT 0, + date_modified TEXT NOT NULL, + date_created TEXT NOT NULL +); + +CREATE INDEX notes_image_note_id_index ON notes_image (note_id); +CREATE INDEX notes_image_image_id_index ON notes_image (image_id); +CREATE INDEX notes_image_note_id_image_id_index ON notes_image (note_id, image_id); \ No newline at end of file