Skip to content

Commit

Permalink
chore: Add an initial Sqitch schema for SQLite.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhess committed Mar 1, 2023
1 parent 5e1b260 commit f96fd3f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ cabal.project.local*

# generated files
/openapi.json

# SQLite
*.db
*.sqlite3
3 changes: 3 additions & 0 deletions sqitch/sqitch.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
[engine "pg"]
target = db:pg:
top_dir = pg
[engine "sqlite"]
target = db:sqlite:
top_dir = sqlite
13 changes: 13 additions & 0 deletions sqitch/sqlite/deploy/sessions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Deploy primer:sessions to sqlite

BEGIN;

CREATE TABLE sessions (
uuid TEXT NOT NULL PRIMARY KEY,
gitversion TEXT NOT NULL,
app TEXT NOT NULL,
name TEXT NOT NULL,
lastmodified DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMIT;
7 changes: 7 additions & 0 deletions sqitch/sqlite/revert/sessions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Revert primer:sessions from sqlite

BEGIN;

DROP TABLE sessions;

COMMIT;
5 changes: 5 additions & 0 deletions sqitch/sqlite/sqitch.plan
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
%syntax-version=1.0.0
%project=primer
%uri=https://github.com/hackworthltd/primer

sessions 2023-03-01T21:10:10Z Drew Hess <[email protected]> # Create the sessions table.
9 changes: 9 additions & 0 deletions sqitch/sqlite/verify/sessions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- Verify primer:sessions on sqlite

BEGIN;

SELECT uuid, gitversion, app, name, lastmodified
FROM sessions
WHERE 0;

ROLLBACK;

0 comments on commit f96fd3f

Please sign in to comment.