add account model + crud ( kassza )

This commit is contained in:
2015-09-20 22:02:02 +02:00
parent 5e1835dff5
commit 6163163b1c
16 changed files with 707 additions and 7 deletions

View File

@@ -0,0 +1,40 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m150920_191201_add__table__account 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('{{%account}}', [
'id_account' => $this->primaryKey(),
'name' => $this->string(64)->notNull(),
'status' => $this->smallInteger()->notNull()->defaultValue(10),
'type' => $this->integer(11)->notNull(),
'created_at' => $this->timestamp()->notNull(),
'updated_at' => $this->timestamp()->notNull(),
], $tableOptions);
}
public function down()
{
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}