1
0
Fork 0
compareware/Application/Schema.sql

14 lines
534 B
MySQL
Raw Normal View History

2023-04-16 10:31:32 +00:00
-- Your database schema. Use the Schema Designer at http://localhost:8001/ to add some tables.
2023-04-16 10:32:51 +00:00
CREATE TABLE tasks (
id UUID DEFAULT uuid_generate_v4() PRIMARY KEY NOT NULL,
description TEXT NOT NULL
);
CREATE TABLE tags (
id UUID DEFAULT uuid_generate_v4() PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
2024-04-06 15:47:37 +00:00
task_id UUID NOT NULL,
value TEXT NOT NULL
2023-04-16 10:32:51 +00:00
);
CREATE INDEX tags_task_id_index ON tags (task_id);
ALTER TABLE tags ADD CONSTRAINT tags_ref_task_id FOREIGN KEY (task_id) REFERENCES tasks (id) ON DELETE NO ACTION;