|
- <?php
-
- use yii\db\Migration;
- use yii\db\Schema;
-
- class m161125_075714_commandes_automatiques extends Migration
- {
- public function up()
- {
- $this->createTable('commande_auto', [
- 'id' => 'pk',
- 'id_user' => Schema::TYPE_INTEGER ,
- 'id_etablissement' => Schema::TYPE_INTEGER. ' NOT NULL',
- 'date_debut' => Schema::TYPE_DATE,
- 'date_fin' => Schema::TYPE_DATE,
- 'lundi' => Schema::TYPE_BOOLEAN,
- 'mardi' => Schema::TYPE_BOOLEAN,
- 'mercredi' => Schema::TYPE_BOOLEAN,
- 'jeudi' => Schema::TYPE_BOOLEAN,
- 'vendredi' => Schema::TYPE_BOOLEAN,
- 'samedi' => Schema::TYPE_BOOLEAN,
- 'dimanche' => Schema::TYPE_BOOLEAN,
- 'periodicite_semaine' => Schema::TYPE_INTEGER,
- ]);
-
- $this->createTable('commande_auto_produit', [
- 'id' => 'pk',
- 'id_commande_auto' => Schema::TYPE_INTEGER . ' NOT NULL',
- 'id_produit' => Schema::TYPE_INTEGER . ' NOT NULL',
- 'quantite' => Schema::TYPE_FLOAT,
- ]);
- }
-
- public function down()
- {
- $this->dropTable('commande_auto') ;
- $this->dropTable('commande_auto_produit') ;
- }
-
- /*
- // Use safeUp/safeDown to run migration code within a transaction
- public function safeUp()
- {
- }
-
- public function safeDown()
- {
- }
- */
- }
|