Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
cee45fdf
Commit
cee45fdf
authored
Jul 14, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added docs description of abstract db types in migration
replaces #618
parent
b427b5fb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
migration.md
docs/guide/migration.md
+11
-1
No files found.
docs/guide/migration.md
View file @
cee45fdf
...
...
@@ -84,7 +84,7 @@ class m101129_185401_create_news_table extends \yii\db\Migration
{
$this
->
db
->
createCommand
()
->
createTable
(
'tbl_news, array(
'
id
' => '
pk
',
'
title
' => '
string
NOT
NULL
',
'
title
' => '
string
(
128
)
NOT
NULL
',
'
content
' => '
text
',
))->execute();
}
...
...
@@ -99,6 +99,16 @@ class m101129_185401_create_news_table extends \yii\db\Migration
The base class
[
\yii\db\Migration
]
exposes a database connection via
`db`
property. You can use it for manipulating data and schema of a database.
The column types used in this example are abstract types that will be replaced
by Yii with the corresponding types depended on your database management system.
You can use them to write database independent migrations.
For example
`pk`
will be replaced by
`int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY`
for MySQL and
`integer PRIMARY KEY AUTOINCREMENT NOT NULL`
for sqlite.
See documentation of
[
[QueryBuilder::getColumnType()
]
] for more details and a list
of available types. You may also use the constants defined in
[
[\yii\db\Schema
]
] to
create column types.
Transactional Migrations
------------------------
...
...
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