The sqlite3store library expects the sessions table to exist but does not create it. On fresh deployments, the session store would fail. Uses IF NOT EXISTS to be safe on databases where the table was created outside of goose.
13 lines
283 B
SQL
13 lines
283 B
SQL
-- +goose Up
|
|
CREATE TABLE IF NOT EXISTS sessions (
|
|
token TEXT PRIMARY KEY,
|
|
data BLOB NOT NULL,
|
|
expiry REAL NOT NULL
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS sessions_expiry_idx ON sessions(expiry);
|
|
|
|
-- +goose Down
|
|
DROP INDEX IF EXISTS sessions_expiry_idx;
|
|
DROP TABLE IF EXISTS sessions;
|