Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

m161125_075714_commandes_automatiques.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. class m161125_075714_commandes_automatiques extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->createTable('commande_auto', [
  9. 'id' => 'pk',
  10. 'id_user' => Schema::TYPE_INTEGER ,
  11. 'id_etablissement' => Schema::TYPE_INTEGER. ' NOT NULL',
  12. 'date_debut' => Schema::TYPE_DATE,
  13. 'date_fin' => Schema::TYPE_DATE,
  14. 'lundi' => Schema::TYPE_BOOLEAN,
  15. 'mardi' => Schema::TYPE_BOOLEAN,
  16. 'mercredi' => Schema::TYPE_BOOLEAN,
  17. 'jeudi' => Schema::TYPE_BOOLEAN,
  18. 'vendredi' => Schema::TYPE_BOOLEAN,
  19. 'samedi' => Schema::TYPE_BOOLEAN,
  20. 'dimanche' => Schema::TYPE_BOOLEAN,
  21. 'periodicite_semaine' => Schema::TYPE_INTEGER,
  22. ]);
  23. $this->createTable('commande_auto_produit', [
  24. 'id' => 'pk',
  25. 'id_commande_auto' => Schema::TYPE_INTEGER . ' NOT NULL',
  26. 'id_produit' => Schema::TYPE_INTEGER . ' NOT NULL',
  27. 'quantite' => Schema::TYPE_FLOAT,
  28. ]);
  29. }
  30. public function down()
  31. {
  32. $this->dropTable('commande_auto') ;
  33. $this->dropTable('commande_auto_produit') ;
  34. }
  35. /*
  36. // Use safeUp/safeDown to run migration code within a transaction
  37. public function safeUp()
  38. {
  39. }
  40. public function safeDown()
  41. {
  42. }
  43. */
  44. }