add contract
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160123_222804_alter__table__ticket_installment_request__add__column__ugiro__number extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("ticket_installment_request", "number", "int");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m160123_222804_alter__table__ticket_installment_request__add__column__ugiro__number cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
50
console/migrations/m160124_135213_add__table__contract.php
Normal file
50
console/migrations/m160124_135213_add__table__contract.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160124_135213_add__table__contract 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('{{%contract}}', [
|
||||
'id_contract' => $this->primaryKey(),
|
||||
'id_user' => $this->integer(11),
|
||||
'id_customer' => $this->integer(11),
|
||||
'status' => $this->integer(11),
|
||||
'flag' => $this->integer(11),
|
||||
'part_paid' => $this->integer(11),
|
||||
'part_count' => $this->integer(11),
|
||||
'part_required' => $this->integer(11),
|
||||
'expired_at' => $this->dateTime()->notNull(),
|
||||
'created_at' => $this->dateTime()->notNull(),
|
||||
'updated_at' => $this->dateTime()->notNull(),
|
||||
], $tableOptions);
|
||||
|
||||
$this->addColumn("ticket", "id_contract", "int");
|
||||
$this->addColumn("ticket_installment_request", "id_contract", "int");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160124_204003_alter__table__contract__add__field__ticket_type extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("contract", "id_ticket_type", "int");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m160124_204003_alter__table__contract__add__field__ticket_type cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
44
console/migrations/m160124_235346_add_product_buntetes.php
Normal file
44
console/migrations/m160124_235346_add_product_buntetes.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
use common\models\Product;
|
||||
use common\models\ProductCategory;
|
||||
|
||||
class m160124_235346_add_product_buntetes extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$productCategory = new ProductCategory();
|
||||
$productCategory->name = "Büntetések";
|
||||
$productCategory->status = ProductCategory::STATUS_ACTIVE;
|
||||
|
||||
$productCategory->save(false);
|
||||
|
||||
$product = new Product();
|
||||
$product->name = "Büntetés Szerződés 3000 ft";
|
||||
$product->product_number = "buntetes3000";
|
||||
$product->id_account = 1;
|
||||
$product->purchase_price = 0;
|
||||
$product->sale_price = 3000;
|
||||
$product->id_product_category = $productCategory->id_product_category;
|
||||
$product->save(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user