]> git.ktnx.net Git - lsl.git/blobdiff - sql/schema/init.sql
first take at a Dancer2 app, some functions work
[lsl.git] / sql / schema / init.sql
diff --git a/sql/schema/init.sql b/sql/schema/init.sql
new file mode 100644 (file)
index 0000000..3eed88d
--- /dev/null
@@ -0,0 +1,17 @@
+create table globals(
+    lists_version bigint not null,
+    db_revision bigint not null );
+
+insert into globals(lists_version, db_revision) values(1, 0);
+
+create table shopping_lists(
+    id bigserial primary key,
+    name text not null,
+    version bigint not null default 1 );
+
+create table shopping_list_items(
+    id bigserial primary key,
+    shopping_list bigint not null references shopping_lists(id),
+    description text not null,
+    version bigint not null default 1,
+    done boolean not null default false );