refactored scheme

This commit is contained in:
2025-10-31 13:39:04 +01:00
parent 9491da2950
commit f49da68e15
3 changed files with 3 additions and 0 deletions

Binary file not shown.

View File

@@ -1,3 +1,5 @@
-- MUST BE UPDATED BEFORE USE
USE borrow_system_new; USE borrow_system_new;
-- Optional: keep insert order predictable -- Optional: keep insert order predictable

View File

@@ -25,6 +25,7 @@ CREATE TABLE loans (
loaned_items_id json NOT NULL DEFAULT ('[]'), loaned_items_id json NOT NULL DEFAULT ('[]'),
loaned_items_name json NOT NULL DEFAULT ('[]'), loaned_items_name json NOT NULL DEFAULT ('[]'),
deleted bool NOT NULL DEFAULT false, deleted bool NOT NULL DEFAULT false,
note varchar(500) DEFAULT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT fk_loans_username CONSTRAINT fk_loans_username
FOREIGN KEY (username) REFERENCES users(username) FOREIGN KEY (username) REFERENCES users(username)