You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
640B

  1. <?php
  2. use yii\db\Schema;
  3. use yii\db\Migration;
  4. class m150317_210256_table_produit extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->createTable('produit', [
  9. 'id' => 'pk',
  10. 'nom' => Schema::TYPE_STRING . ' NOT NULL',
  11. 'description' => Schema::TYPE_STRING,
  12. 'actif' => Schema::TYPE_BOOLEAN,
  13. 'illustration' => Schema::TYPE_STRING,
  14. 'photo' => Schema::TYPE_STRING,
  15. 'saison' => Schema::TYPE_STRING .' NOT NULL',
  16. 'prix' => Schema::TYPE_FLOAT,
  17. 'poids' => Schema::TYPE_FLOAT,
  18. ]);
  19. }
  20. public function down()
  21. {
  22. $this->dropTable('produit');
  23. }
  24. }