summaryrefslogtreecommitdiff
path: root/migrations/2020-02-04-223649_entry_data/up.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/2020-02-04-223649_entry_data/up.sql')
-rw-r--r--migrations/2020-02-04-223649_entry_data/up.sql15
1 files changed, 15 insertions, 0 deletions
diff --git a/migrations/2020-02-04-223649_entry_data/up.sql b/migrations/2020-02-04-223649_entry_data/up.sql
new file mode 100644
index 0000000..dde9288
--- /dev/null
+++ b/migrations/2020-02-04-223649_entry_data/up.sql
@@ -0,0 +1,15 @@
+create table entry_data (
+ username varchar not null,
+ entry_type varchar(16) not null,
+ entry_id bigint not null,
+ data_type varchar(8) not null,
+ data_id bigint not null,
+
+primary key(username, entry_type, entry_id, data_type, data_id),
+
+foreign key (username, entry_type, entry_id)
+references entries(username, entry_type, id),
+
+foreign key (data_type, data_id)
+references raw_data(data_type, id)
+);