|
1234567891011121314151617181920212223242526272829303132333435 |
- <?php
-
- use yii\db\Schema;
- use yii\db\Migration;
-
- class m150319_212931_tables_commande extends Migration
- {
- public function up()
- {
-
- $this->createTable('commande', [
- 'id' => 'pk',
- 'id_user' => Schema::TYPE_INTEGER . ' NOT NULL',
- 'date' => Schema::TYPE_DATETIME.' NOT NULL',
- 'date_update' => Schema::TYPE_DATETIME,
- 'id_point_vente' => Schema::TYPE_INTEGER . ' NOT NULL',
- 'id_production' => Schema::TYPE_INTEGER . ' NOT NULL',
- ]);
-
- $this->createTable('commande_produit', [
- 'id' => 'pk',
- 'id_commande' => Schema::TYPE_INTEGER . ' NOT NULL',
- 'id_produit' => Schema::TYPE_INTEGER . ' NOT NULL',
- 'quantite' => Schema::TYPE_FLOAT . ' NOT NULL',
- ]);
-
- }
-
- public function down()
- {
- $this->dropTable('commande');
- $this->dropTable('commande_produit');
- }
-
- }
|