add changes to procurement

This commit is contained in:
2015-09-25 08:57:05 +02:00
parent e2fe006899
commit 28caac03dc
12 changed files with 609 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m150925_055052_add__table_procurement 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('{{%procurement}}', [
'id_procurement' => $this->primaryKey(),
'id_warehouse' => $this->integer()->notNull(),
'id_user' => $this->integer()->notNull(),
'id_product' => $this->integer()->notNull(),
'count' => $this->integer()->notNull(),
'stock' => $this->integer(),
'purchase_price' => $this->integer(),
'description' => $this->string(255),
'created_at' => $this->timestamp()->notNull(),
'updated_at' => $this->timestamp()->notNull(),
], $tableOptions);
}
public function down()
{
echo "m150925_055052_add__table_procurement cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}