aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorJulien Dessaux2021-05-12 22:57:49 +0200
committerJulien Dessaux2021-05-12 22:57:49 +0200
commitf9369f1bba2b0edcdcda3d1f104771309ecc4d23 (patch)
treedd9e9680cf5c3d386f6af859a250e4cadef7d7fa /pkg
parentUpdated dependencies (diff)
downloadtrains-f9369f1bba2b0edcdcda3d1f104771309ecc4d23.tar.gz
trains-f9369f1bba2b0edcdcda3d1f104771309ecc4d23.tar.bz2
trains-f9369f1bba2b0edcdcda3d1f104771309ecc4d23.zip
Fixed sessions schema
Diffstat (limited to '')
-rw-r--r--pkg/database/migrations.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/database/migrations.go b/pkg/database/migrations.go
index 7de255a..6a3d923 100644
--- a/pkg/database/migrations.go
+++ b/pkg/database/migrations.go
@@ -19,7 +19,7 @@ var allMigrations = []func(tx *sql.Tx) error{
last_login_at DATE DEFAULT NULL
);
CREATE TABLE sessions (
- token TEXT NOT NULL UNIQUE,
+ token TEXT PRIMARY KEY,
user_id INTEGER NOT NULL,
created_at DATE DEFAULT (datetime('now')),
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE