diff options
author | Julien Dessaux | 2021-05-12 22:57:49 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-05-12 22:57:49 +0200 |
commit | f9369f1bba2b0edcdcda3d1f104771309ecc4d23 (patch) | |
tree | dd9e9680cf5c3d386f6af859a250e4cadef7d7fa /pkg | |
parent | Updated dependencies (diff) | |
download | trains-f9369f1bba2b0edcdcda3d1f104771309ecc4d23.tar.gz trains-f9369f1bba2b0edcdcda3d1f104771309ecc4d23.tar.bz2 trains-f9369f1bba2b0edcdcda3d1f104771309ecc4d23.zip |
Fixed sessions schema
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/database/migrations.go | 2 |
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 |