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.

m150319_212931_tables_commande.php 881B

8 yıl önce
1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use yii\db\Schema;
  3. use yii\db\Migration;
  4. class m150319_212931_tables_commande extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->createTable('commande', [
  9. 'id' => 'pk',
  10. 'id_user' => Schema::TYPE_INTEGER . ' NOT NULL',
  11. 'date' => Schema::TYPE_DATETIME.' NOT NULL',
  12. 'date_update' => Schema::TYPE_DATETIME,
  13. 'id_point_vente' => Schema::TYPE_INTEGER . ' NOT NULL',
  14. 'id_production' => Schema::TYPE_INTEGER . ' NOT NULL',
  15. ]);
  16. $this->createTable('commande_produit', [
  17. 'id' => 'pk',
  18. 'id_commande' => Schema::TYPE_INTEGER . ' NOT NULL',
  19. 'id_produit' => Schema::TYPE_INTEGER . ' NOT NULL',
  20. 'quantite' => Schema::TYPE_FLOAT . ' NOT NULL',
  21. ]);
  22. }
  23. public function down()
  24. {
  25. $this->dropTable('commande');
  26. $this->dropTable('commande_produit');
  27. }
  28. }