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
ee2a6b7e
Commit
ee2a6b7e
authored
Feb 16, 2014
by
Sergey Gonimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Migration.php
parent
e1f4a9cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Migration.php
framework/db/Migration.php
+4
-4
No files found.
framework/db/Migration.php
View file @
ee2a6b7e
...
@@ -388,15 +388,15 @@ class Migration extends \yii\base\Component
...
@@ -388,15 +388,15 @@ class Migration extends \yii\base\Component
* Builds and executes a SQL statement for creating a new index.
* Builds and executes a SQL statement for creating a new index.
* @param string $name the name of the index. The name will be properly quoted by the method.
* @param string $name the name of the index. The name will be properly quoted by the method.
* @param string $table the table that the new index will be created for. The table name will be properly quoted by the method.
* @param string $table the table that the new index will be created for. The table name will be properly quoted by the method.
* @param string
$column
the column(s) that should be included in the index. If there are multiple columns, please separate them
* @param string
|array $columns
the column(s) that should be included in the index. If there are multiple columns, please separate them
* by commas or use an array. The column names will be properly quoted by the method.
* by commas or use an array. The column names will be properly quoted by the method.
* @param boolean $unique whether to add UNIQUE constraint on the created index.
* @param boolean $unique whether to add UNIQUE constraint on the created index.
*/
*/
public
function
createIndex
(
$name
,
$table
,
$column
,
$unique
=
false
)
public
function
createIndex
(
$name
,
$table
,
$column
s
,
$unique
=
false
)
{
{
echo
" > create"
.
(
$unique
?
' unique'
:
''
)
.
" index
$name
on
$table
("
.
implode
(
','
,
(
array
)
$column
)
.
") ..."
;
echo
" > create"
.
(
$unique
?
' unique'
:
''
)
.
" index
$name
on
$table
("
.
implode
(
','
,
(
array
)
$column
s
)
.
") ..."
;
$time
=
microtime
(
true
);
$time
=
microtime
(
true
);
$this
->
db
->
createCommand
()
->
createIndex
(
$name
,
$table
,
$column
,
$unique
)
->
execute
();
$this
->
db
->
createCommand
()
->
createIndex
(
$name
,
$table
,
$column
s
,
$unique
)
->
execute
();
echo
" done (time: "
.
sprintf
(
'%.3f'
,
microtime
(
true
)
-
$time
)
.
"s)
\n
"
;
echo
" done (time: "
.
sprintf
(
'%.3f'
,
microtime
(
true
)
-
$time
)
.
"s)
\n
"
;
}
}
...
...
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