Commit 0868e7d3 by Paul Klimov

MVA added to "Sphinx" unit tests.

parent 6e3dfb8f
...@@ -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'];
......
# 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
} }
......
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment