m161021_073634_table_etablissement.php 848B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. class m161021_073634_table_etablissement extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->createTable('etablissement', [
  9. 'id' => 'pk',
  10. 'nom' => Schema::TYPE_STRING . ' NOT NULL',
  11. 'siret' => Schema::TYPE_STRING . ' NOT NULL',
  12. 'logo' => Schema::TYPE_STRING,
  13. 'photo' => Schema::TYPE_STRING,
  14. 'description' => Schema::TYPE_TEXT,
  15. 'code_postal' => Schema::TYPE_STRING,
  16. 'ville' => Schema::TYPE_STRING,
  17. ]);
  18. }
  19. public function down()
  20. {
  21. $this->dropTable('etablissement') ;
  22. }
  23. /*
  24. // Use safeUp/safeDown to run migration code within a transaction
  25. public function safeUp()
  26. {
  27. }
  28. public function safeDown()
  29. {
  30. }
  31. */
  32. }