Skip to content
Snippets Groups Projects
Commit 67b57000 authored by Markus Osterhoff's avatar Markus Osterhoff
Browse files

small fixes on mariadDB_create_emptyDB.sql

but probably not yet fully perfect
parent 4080f16b
No related branches found
No related tags found
1 merge request!3first changes @ P10 beamline
......@@ -263,16 +263,6 @@ CREATE TRIGGER `ins_last_updated_pages` AFTER INSERT ON `snips` FOR EACH ROW UPD
WHERE pages.id = NEW.page_id
$$
DELIMITER ;
-- Trigger
DELIMITER $$
CREATE TRIGGER `ins_last_updated_pages` AFTER INSERT ON `books` FOR EACH ROW UPDATE pages
SET pages.last_updated = current_timestamp()
WHERE pages.id = NEW.page_id
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `upd_last_updated_books` AFTER UPDATE ON `pages` FOR EACH ROW UPDATE books
SET books.last_updated = CURRENT_TIMESTAMP()
......@@ -281,8 +271,7 @@ $$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `upd_last_updated_pages` AFTER UPDATE ON `snips` FOR EACH ROW UPDATE pages
SET pages.last_updated = current_timestamp() WHERE pages.id = NEW.page_id,
SET NEW.last_updated = current_timestamp()
SET pages.last_updated = current_timestamp() WHERE pages.id = NEW.page_id
$$
DELIMITER ;
......@@ -322,4 +311,4 @@ FLUSH PRIVILEGES;
-- Add background type to books table
ALTER TABLE books ADD background_type_id INT NOT NULL DEFAULT 1,
ADD FOREIGN KEY (background_type_id) REFERENCES background_types(id);
\ No newline at end of file
ADD FOREIGN KEY (background_type_id) REFERENCES background_types(id);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment