Browse Source

Modifier la structure de la base de données pour intégrer les boulangeries

master
keun 8 years ago
parent
commit
c34e5111c8
2 changed files with 64 additions and 0 deletions
  1. +32
    -0
      console/migrations/m161012_074719_infos_boulanger.php
  2. +32
    -0
      console/migrations/m161012_075736_ajout_ids_boulangerie.php

+ 32
- 0
console/migrations/m161012_074719_infos_boulanger.php View File

@@ -0,0 +1,32 @@
<?php

use yii\db\Schema;
use yii\db\Migration;

class m161012_074719_infos_boulanger extends Migration
{
public function up()
{
$this->addColumn('user', 'is_boulanger', Schema::TYPE_BOOLEAN) ;
$this->addColumn('user', 'nom_magasin', Schema::TYPE_STRING) ;
$this->addColumn('user', 'siret', Schema::TYPE_STRING) ;
}

public function down()
{
$this->dropColumn('user', 'is_boulanger') ;
$this->dropColumn('user', 'nom_magasin') ;
$this->dropColumn('user', 'siret') ;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

+ 32
- 0
console/migrations/m161012_075736_ajout_ids_boulangerie.php View File

@@ -0,0 +1,32 @@
<?php

use yii\db\Schema;
use yii\db\Migration;

class m161012_075736_ajout_ids_boulangerie extends Migration
{
public function up()
{
$this->addColumn('produit', 'id_boulangerie', Schema::TYPE_INTEGER) ;
$this->addColumn('production', 'id_boulangerie', Schema::TYPE_INTEGER) ;
$this->addColumn('point_vente', 'id_boulangerie', Schema::TYPE_INTEGER) ;
}

public function down()
{
$this->dropColumn('produit', 'id_boulangerie') ;
$this->dropColumn('production', 'id_boulangerie') ;
$this->dropColumn('point_vente', 'id_boulangerie') ;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

Loading…
Cancel
Save