forked from cebe/yii2-openapi
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathm200000_000003_create_table_fakerable.php
More file actions
33 lines (31 loc) · 1.11 KB
/
m200000_000003_create_table_fakerable.php
File metadata and controls
33 lines (31 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* Table for Fakerable
*/
class m200000_000003_create_table_fakerable extends \yii\db\Migration
{
public function up()
{
$this->createTable('{{%fakerable}}', [
'id' => $this->bigPrimaryKey(),
'active' => $this->boolean()->notNull(),
'floatval' => $this->float()->notNull(),
'floatval_lim' => $this->float()->notNull(),
'doubleval' => $this->double()->notNull(),
'int_min' => $this->integer()->notNull()->defaultValue(3),
'int_max' => $this->integer()->notNull(),
'int_minmax' => $this->integer()->notNull(),
'int_created_at' => $this->integer()->notNull(),
'int_simple' => $this->integer()->notNull(),
'str_text' => $this->text()->notNull(),
'str_varchar' => $this->string(100)->notNull(),
'str_date' => $this->date()->notNull(),
'str_datetime' => $this->timestamp()->notNull(),
'str_country' => $this->text()->notNull(),
]);
}
public function down()
{
$this->dropTable('{{%fakerable}}');
}
}