initial commit
[squeep-indie-auther] / src / db / sqlite / sql / schema / init.sql
diff --git a/src/db/sqlite/sql/schema/init.sql b/src/db/sqlite/sql/schema/init.sql
new file mode 100644 (file)
index 0000000..8e2a475
--- /dev/null
@@ -0,0 +1,11 @@
+--
+BEGIN;
+       CREATE TABLE _meta_schema_version (
+               major INTEGER NOT NULL CHECK (typeof(major) = 'integer'),
+               minor INTEGER NOT NULL CHECK (typeof(minor) = 'integer'),
+               patch INTEGER NOT NULL CHECK (typeof(patch) = 'integer'),
+               applied INTEGER NOT NULL DEFAULT (strftime('%s', 'now')) CHECK (typeof(applied) = 'integer'),
+               PRIMARY KEY (major DESC, minor DESC, patch DESC)
+       ) WITHOUT ROWID;
+       INSERT INTO _meta_schema_version (major, minor, patch) VALUES (0, 0, 0);
+COMMIT;