From 495ad633336f61b4c22286ece683ed627d1464c4 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 4 May 2012 17:37:30 -0400 Subject: [PATCH] CC-3732: NationTalk Database upgrade fail, from 2.0.3 to 2.1.0 -move NOT NULL constraint to after the column has been populated --- .../upgrades/airtime-2.1.0/common/Version20120411174904.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_minimal/upgrades/airtime-2.1.0/common/Version20120411174904.php b/install_minimal/upgrades/airtime-2.1.0/common/Version20120411174904.php index 3c5891c99..436070b3b 100644 --- a/install_minimal/upgrades/airtime-2.1.0/common/Version20120411174904.php +++ b/install_minimal/upgrades/airtime-2.1.0/common/Version20120411174904.php @@ -13,18 +13,18 @@ class Version20120411174904 extends AbstractMigration public function up(Schema $schema) { $this->_addSql("ALTER TABLE cc_show_instances ADD created timestamp"); - $this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN created SET NOT NULL"); - $this->_addSql("ALTER TABLE cc_show_instances ADD last_scheduled timestamp"); //setting these to a default now for timeline refresh purposes. $now = gmdate("Y-m-d H:i:s"); $this->_addSql("UPDATE cc_show_instances SET created = '$now'"); $this->_addSql("UPDATE cc_show_instances SET last_scheduled = '$now'"); + + $this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN created SET NOT NULL"); } public function down(Schema $schema) { } -} \ No newline at end of file +}