Skip to content

Commit 7566071

Browse files
committed
Pg fix: drop NOT NULL constraint from user ban
1 parent 6cda08f commit 7566071

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sogs/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def user_perm_future_updates(conn):
550550
conn.execute(
551551
"""
552552
CREATE TABLE user_ban_futures (
553-
room INTEGER NOT NULL REFERENCES rooms ON DELETE CASCADE,
553+
room INTEGER REFERENCES rooms ON DELETE CASCADE,
554554
"user" INTEGER NOT NULL REFERENCES users ON DELETE CASCADE,
555555
at FLOAT NOT NULL, /* when the change should take effect (unix epoch) */
556556
banned BOOLEAN NOT NULL /* if true then ban at `at`, if false then unban */

sogs/schema.pgsql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ CREATE INDEX user_permissions_future_room_user ON user_permission_futures(room,
376376
-- their user_permissions.banned to TRUE then add a row here with banned = FALSE to schedule the
377377
-- unban. (You can also schedule a future *ban* here, but the utility of that is less clear).
378378
CREATE TABLE user_ban_futures (
379-
room INTEGER NOT NULL REFERENCES rooms ON DELETE CASCADE,
379+
room INTEGER REFERENCES rooms ON DELETE CASCADE,
380380
"user" INTEGER NOT NULL REFERENCES users ON DELETE CASCADE,
381381
at FLOAT NOT NULL, /* when the change should take effect (unix epoch) */
382382
banned BOOLEAN NOT NULL /* if true then ban at `at`, if false then unban */

0 commit comments

Comments
 (0)