mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Fix sqlite migrations for preferences.
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
name = "Add Progress Bars"
|
||||
|
||||
/datum/migration/sqlite/ss13_prefs/_002/up()
|
||||
if(!hasColumn("progress_bars"))
|
||||
if(!hasColumn("client","progress_bars"))
|
||||
return execute("ALTER TABLE `client` ADD COLUMN progress_bars INTEGER DEFAULT 1")
|
||||
return TRUE
|
||||
|
||||
/datum/migration/sqlite/ss13_prefs/_002/down()
|
||||
if(hasColumn("progress_bars"))
|
||||
if(hasColumn("client","progress_bars"))
|
||||
return execute("ALTER TABLE `client` DROP COLUMN progress_bars")
|
||||
return TRUE
|
||||
|
||||
@@ -67,7 +67,8 @@ CREATE TABLE IF NOT EXISTS [TABLE_NAME] (
|
||||
return FALSE
|
||||
|
||||
/datum/migration_controller/sqlite/hasTable(var/tableName)
|
||||
return hasResult("SELECT name FROM sqlite_master WHERE type='[tableName]'")
|
||||
var/exists = hasResult("SELECT name FROM sqlite_master WHERE type='table' AND name='[tableName]';")
|
||||
return exists
|
||||
|
||||
#ifdef DEBUG_SQLITE_MIGCON
|
||||
#undef _DEBUG
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
return TRUE
|
||||
|
||||
/datum/migration/sqlite/hasTable(var/tableName)
|
||||
return hasResult("SELECT name FROM sqlite_master WHERE type='[tableName]'")
|
||||
var/exists = hasResult("SELECT name FROM sqlite_master WHERE type='table' AND name='[tableName]';")
|
||||
return exists
|
||||
|
||||
/datum/migration/sqlite/hasColumn(var/tableName, var/columnName)
|
||||
for(var/list/row in query("PRAGMA table_info([tableName])")) // Can't be turned into a SELECT.
|
||||
|
||||
Reference in New Issue
Block a user