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
0868e7d3
Commit
0868e7d3
authored
Nov 12, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVA added to "Sphinx" unit tests.
parent
6e3dfb8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
Schema.php
extensions/sphinx/Schema.php
+1
-4
sphinx.conf
tests/unit/data/sphinx/sphinx.conf
+10
-2
sphinx.sql
tests/unit/data/sphinx/sphinx.sql
+14
-0
No files found.
extensions/sphinx/Schema.php
View file @
0868e7d3
...
@@ -86,9 +86,6 @@ class Schema extends \yii\db\mysql\Schema
...
@@ -86,9 +86,6 @@ class Schema extends \yii\db\mysql\Schema
$table
->
columns
[
$column
->
name
]
=
$column
;
$table
->
columns
[
$column
->
name
]
=
$column
;
if
(
$column
->
isPrimaryKey
)
{
if
(
$column
->
isPrimaryKey
)
{
$table
->
primaryKey
[]
=
$column
->
name
;
$table
->
primaryKey
[]
=
$column
->
name
;
if
(
$column
->
autoIncrement
)
{
$table
->
sequenceName
=
''
;
}
}
}
}
}
return
true
;
return
true
;
...
@@ -104,9 +101,9 @@ class Schema extends \yii\db\mysql\Schema
...
@@ -104,9 +101,9 @@ class Schema extends \yii\db\mysql\Schema
$column
=
new
ColumnSchema
;
$column
=
new
ColumnSchema
;
$column
->
name
=
$info
[
'Field'
];
$column
->
name
=
$info
[
'Field'
];
$column
->
isPrimaryKey
=
(
$column
->
name
==
'id'
);
// Not supported :
// Not supported :
//$column->allowNull = $info['Null'] === 'YES';
//$column->allowNull = $info['Null'] === 'YES';
//$column->isPrimaryKey = strpos($info['Key'], 'PRI') !== false;
//$column->autoIncrement = stripos($info['Extra'], 'auto_increment') !== false;
//$column->autoIncrement = stripos($info['Extra'], 'auto_increment') !== false;
//$column->comment = $info['Comment'];
//$column->comment = $info['Comment'];
...
...
tests/unit/data/sphinx/sphinx.conf
View file @
0868e7d3
# Sphinx configuration for the unit tests
#
#
# Minimal Sphinx configuration sample (clean, simple, functional)
# Setup test environment:
#
# - initialize test database source:
# mysql -D yii2test -u test < /path/to/yii/tests/unit/data/sphinx/sphinx.sql
# - setup test Sphinx indexes:
# indexer --config /path/to/yii/tests/unit/data/sphinx/sphinx.conf --all [--rotate]
# - run the "searchd" daemon:
# searchd --config /path/to/yii/tests/unit/data/sphinx/sphinx.conf
source
yii2_test_article_src
source
yii2_test_article_src
{
{
...
@@ -19,6 +26,7 @@ source yii2_test_article_src
...
@@ -19,6 +26,7 @@ source yii2_test_article_src
sql_attr_uint
=
id
sql_attr_uint
=
id
sql_attr_uint
=
author_id
sql_attr_uint
=
author_id
sql_attr_timestamp
=
add_date
sql_attr_timestamp
=
add_date
sql_attr_multi
=
uint
tag
from
query
;
SELECT
article_id
AS
id
,
tag_id
AS
tag
FROM
yii2_test_article_tag
sql_query_info
=
SELECT
*
FROM
yii2_test_article
WHERE
id
=$
id
sql_query_info
=
SELECT
*
FROM
yii2_test_article
WHERE
id
=$
id
}
}
...
...
tests/unit/data/sphinx/sphinx.sql
View file @
0868e7d3
...
@@ -26,3 +26,16 @@ CREATE TABLE IF NOT EXISTS `yii2_test_item` (
...
@@ -26,3 +26,16 @@ CREATE TABLE IF NOT EXISTS `yii2_test_item` (
INSERT
INTO
`yii2_test_item`
(
`id`
,
`name`
,
`description`
,
`category_id`
,
`price`
)
VALUES
INSERT
INTO
`yii2_test_item`
(
`id`
,
`name`
,
`description`
,
`category_id`
,
`price`
)
VALUES
(
1
,
'pencil'
,
'Simple pencil'
,
1
,
2
.
5
),
(
1
,
'pencil'
,
'Simple pencil'
,
1
,
2
.
5
),
(
2
,
'table'
,
'Wooden table'
,
2
,
100
);
(
2
,
'table'
,
'Wooden table'
,
2
,
100
);
CREATE
TABLE
IF
NOT
EXISTS
`yii2_test_article_tag`
(
`article_id`
int
(
11
)
NOT
NULL
,
`tag_id`
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
`article_id`
,
`tag_id`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
;
INSERT
INTO
`yii2_test_article_tag`
(
`article_id`
,
`tag_id`
)
VALUES
(
1
,
1
),
(
1
,
2
),
(
1
,
3
),
(
2
,
3
),
(
2
,
4
);
\ No newline at end of file
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