1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-03-09 15:39:59 +00:00
yii2-nomer/migrations/m170327_094510_create_plans_table.php
2020-02-05 06:34:26 +03:00

49 lines
1 KiB
PHP

<?php
use yii\db\Migration;
/**
* Handles the creation of table `plans`.
*/
class m170327_094510_create_plans_table extends Migration
{
/**
* @inheritdoc
*/
public function up()
{
$this->createTable('plans', [
'id' => $this->primaryKey(),
'cost' => $this->integer(),
'count' => $this->integer(),
'title' => $this->string(),
'status' => $this->boolean()->defaultValue(true)
]);
$this->insert("plans", [
"cost" => 40,
"count" => 30,
"title" => "Предоплаченный-30"
]);
$this->insert("plans", [
"cost" => 30,
"count" => 50,
"title" => "Предоплаченный-50"
]);
$this->insert("plans", [
"cost" => 25,
"count" => 100,
"title" => "Предоплаченный-100"
]);
}
/**
* @inheritdoc
*/
public function down()
{
$this->dropTable('plans');
}
}