Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Junaid Rahman pv
test-project
Commits
cddb71b4
Commit
cddb71b4
authored
Aug 31, 2016
by
jomon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code review changes
parent
2b45d808
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
m160830_105840_category.php
common/migrations/db/m160830_105840_category.php
+6
-17
No files found.
common/migrations/db/m160830_105840_category.php
View file @
cddb71b4
<?php
use
yii\db\Migration
;
use
common\models\Category
;
class
m160830_105840_category
extends
Migration
{
/* public function up()
{
}
public function down()
{
echo "m160830_105840_category cannot be reverted.\n";
return false;
}*/
public
function
safeUp
()
{
...
...
@@ -30,8 +19,7 @@ class m160830_105840_category extends Migration
'description'
=>
$this
->
string
(
512
),
'image_url'
=>
$this
->
string
(
1024
),
'image_path'
=>
$this
->
string
(
1024
),
'status'
=>
$this
->
smallInteger
()
->
notNull
(),
//->defaultValue(Category::STATUS_ACTIVE),
'status'
=>
$this
->
smallInteger
()
->
notNull
()
->
defaultValue
(
Category
::
STATUS_ACTIVE
),
'created_at'
=>
$this
->
integer
(),
'updated_at'
=>
$this
->
integer
()
],
$tableOptions
);
...
...
@@ -40,13 +28,14 @@ class m160830_105840_category extends Migration
'id'
=>
$this
->
primaryKey
(),
'category_id'
=>
$this
->
integer
()
->
notNull
(),
'code'
=>
$this
->
string
(
32
)
->
notNull
(),
'type'
=>
$this
->
string
(
32
),
'name'
=>
$this
->
string
(
32
),
'type'
=>
$this
->
string
(
32
)
->
notNull
()
,
'name'
=>
$this
->
string
(
32
)
->
notNull
()
,
'created_at'
=>
$this
->
integer
(),
'updated_at'
=>
$this
->
integer
()
],
$tableOptions
);
$this
->
addForeignKey
(
'fk_category'
,
'{{%category_files}}'
,
'category_id'
,
'{{%category}}'
,
'id'
,
'cascade'
,
'cascade'
);
$this
->
addForeignKey
(
'fk_category'
,
'{{%category_files}}'
,
'category_id'
,
'{{%category}}'
,
'id'
,
'cascade'
,
'cascade'
);
}
public
function
safeDown
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment