mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
49
migrations/m170327_094510_create_plans_table.php
Normal file
49
migrations/m170327_094510_create_plans_table.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?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');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue