add city, customer and card model + crud
This commit is contained in:
48
console/migrations/m150925_194508_add__table__customer.php
Normal file
48
console/migrations/m150925_194508_add__table__customer.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m150925_194508_add__table__customer extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$tableOptions = null;
|
||||
if ($this->db->driverName === 'mysql') {
|
||||
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
|
||||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
|
||||
}
|
||||
|
||||
$this->createTable('{{%customer}}', [
|
||||
'id_customer' => $this->primaryKey(),
|
||||
'id_customer_card' => $this->integer(),
|
||||
'id_user' => $this->integer(),
|
||||
'id_partner_card' => $this->integer(),
|
||||
'id_proposer' =>$this->integer(),
|
||||
'name' => $this->string(128),
|
||||
'email' => $this->string(255),
|
||||
'password' => $this->string(32),
|
||||
'phone' => $this->string(20),
|
||||
'sex' => $this->smallInteger(),
|
||||
'date_stundent_card_expire' => $this->date(),
|
||||
'birthdate' => $this->date(),
|
||||
'image' => $this->string(255),
|
||||
'description' => $this->string(255),
|
||||
'tax_number' => $this->string(20),
|
||||
'country' => $this->string(20),
|
||||
'zip' => $this->string(8),
|
||||
'city' => $this->string(30),
|
||||
'address' => $this->string(255),
|
||||
'created_at' => $this->timestamp()->notNull(),
|
||||
'updated_at' => $this->timestamp()->notNull(),
|
||||
], $tableOptions);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m150925_194508_add__table__customer cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user