diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Update/_1257.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1257.php b/Zotlabs/Update/_1257.php new file mode 100644 index 000000000..34c10c372 --- /dev/null +++ b/Zotlabs/Update/_1257.php @@ -0,0 +1,33 @@ +<?php + +namespace Zotlabs\Update; + +class _1257 { + + function run() { + + dbq("START TRANSACTION"); + + $r1 = dbq("TRUNCATE TABLE updates"); + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r2 = dbq("ALTER TABLE updates add ud_host text NOT NULL DEFAULT ''"); + } + + if(ACTIVE_DBTYPE == DBTYPE_MYSQL) { + $r2 = dbq("ALTER TABLE updates add ud_host varchar(191) NOT NULL DEFAULT ''"); + } + + $r3 = dbq("ALTER TABLE updates DROP COLUMN ud_guid"); + + if($r1 && $r2 && $r3) { + dbq("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} |