diff --git a/cosmogramme/sql/patch/patch_304.php b/cosmogramme/sql/patch/patch_304.php index 658c7cbb0693183bdce8f90f934c10c8070d3f48..73b9f7e3a50e99661e37fef5885cb76635798335 100644 --- a/cosmogramme/sql/patch/patch_304.php +++ b/cosmogramme/sql/patch/patch_304.php @@ -2,5 +2,5 @@ $adapter = Zend_Db_Table_Abstract::getDefaultAdapter(); try { - $adapter->query('ALTER TABLE notices_paniers DROP INDEX user_panier, DROP COLUMN id_panier'); + $adapter->query('ALTER TABLE notices_paniers DROP INDEX user_panier, DROP COLUMN id_panier, MODIFY libelle VARCHAR(255)'); } catch(Exception $e) {} diff --git a/tests/db/UpgradeDBTest.php b/tests/db/UpgradeDBTest.php index 5c0dcaca962c6cbbb9c78b7c59ad7f9a9bb3407d..43f4325512a8fa13656a59b1800892b04450c286 100644 --- a/tests/db/UpgradeDBTest.php +++ b/tests/db/UpgradeDBTest.php @@ -866,6 +866,7 @@ class UpgradeDB_304_Test extends UpgradeDBTestCase { $this->query('ALTER TABLE notices_paniers ADD COLUMN id_panier int(11) NOT NULL'); $this->query('UPDATE notices_paniers SET id_panier = id'); $this->query('ALTER TABLE notices_paniers ADD CONSTRAINT user_panier UNIQUE (id_user, id_panier)'); + $this->query('ALTER TABLE notices_paniers MODIFY libelle VARCHAR(50)'); } catch(Exception $e) { } } @@ -881,4 +882,10 @@ class UpgradeDB_304_Test extends UpgradeDBTestCase { public function uniqueIndexUserPanierShouldNotExist() { $this->assertNotIndex('notices_paniers', 'user_panier'); } + + + /** @test */ + public function libelleShouldBeVarChar255() { + $this->assertFieldType('notices_paniers','libelle', 'varchar(255)'); + } } \ No newline at end of file