From b1eee8cc1647ce1fa55f3fc6b538b1154429ae9e Mon Sep 17 00:00:00 2001 From: cryptoguard <cryptoguard@protonmail.com> Date: Wed, 26 Mar 2025 23:17:02 -0400 Subject: [PATCH] Properly update db --- basicswap/db_upgrades.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/basicswap/db_upgrades.py b/basicswap/db_upgrades.py index 192c586..16da49a 100644 --- a/basicswap/db_upgrades.py +++ b/basicswap/db_upgrades.py @@ -427,24 +427,7 @@ def upgradeDatabase(self, db_version): ) elif current_version == 26: db_version += 1 - # First add the column - cursor.execute( - "ALTER TABLE offers ADD COLUMN auto_accept_type INTEGER NOT NULL DEFAULT 0" - ) - - # Then update existing rows based on auto_accept_bids - cursor.execute( - """ - UPDATE offers - SET auto_accept_type = CASE - WHEN auto_accept_bids = 1 THEN 1 - ELSE 0 - END - WHERE auto_accept_type IS NULL - """ - ) - - self.commitDB() + cursor.execute("ALTER TABLE offers ADD COLUMN auto_accept_type INTEGER") if current_version != db_version: self.db_version = db_version self.setIntKV("db_version", db_version, cursor)