diff --git a/db/migrations/20191003105908_code_postaux_alphanumeriques.php b/db/migrations/20191003105908_code_postaux_alphanumeriques.php new file mode 100644 index 0000000000000000000000000000000000000000..8016422062f98b091fa775939ef38531491013c1 --- /dev/null +++ b/db/migrations/20191003105908_code_postaux_alphanumeriques.php @@ -0,0 +1,40 @@ +<?php + + +use Phinx\Migration\AbstractMigration; + +class CodePostauxAlphanumeriques extends AbstractMigration +{ + /** + * Change Method. + * + * Write your reversible migrations using this method. + * + * More information on writing migrations is available here: + * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class + * + * The following commands can be used in this method and Phinx will + * automatically reverse them when rolling back: + * + * createTable + * renameTable + * addColumn + * addCustomColumn + * renameColumn + * addIndex + * addForeignKey + * + * Any other destructive changes will result in an error when trying to + * rollback the migration. + * + * Remember to call "create()" or "update()" and NOT "save()" when working + * with the Table class. + */ + public function change() + { + $adresses = $this->table('adresses'); + $adresses->changeColumn('codepostal', 'string', ['limit' => 20]) + ->update(); + + } +}