add foreign key constraint on client session table

This commit is contained in:
Up committed 2024-05-14 14:33:53 +02:00
1 parent c0aade2e65
commit 834d1e62a0
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -175,7 +175,7 @@ func setupDb(tx *sql.Tx) error {
// MIGRATION 001
`ALTER TABLE sessions DROP COLUMN IF EXISTS active`,
`CREATE TABLE IF NOT EXISTS activeClientSessions (uuid BINARY(16) NOT NULL PRIMARY KEY, clientSessionId VARCHAR(32) NOT NULL)`,
`CREATE TABLE IF NOT EXISTS activeClientSessions (uuid BINARY(16) NOT NULL PRIMARY KEY, clientSessionId VARCHAR(32) NOT NULL, FOREIGN KEY (uuid) REFERENCES accounts (uuid) ON DELETE CASCADE ON UPDATE CASCADE)`,
}
for _, q := range queries {