Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Не применяются миграции #60

Closed
dukensk opened this issue Aug 11, 2016 · 4 comments
Closed

Не применяются миграции #60

dukensk opened this issue Aug 11, 2016 · 4 comments

Comments

@dukensk
Copy link

dukensk commented Aug 11, 2016

Ошибка:

*** applying m160711_132535_delete_foregin_key_from_values
> drop foreign key FK_Value_optionId from table eav_attribute_value ...Exception 'yii\db\Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'artengine.eav_attribute_value' doesn't exist
The SQL being executed was: ALTER TABLE eav_attribute_value DROP FOREIGN KEY FK_Value_optionId'

in D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\db\Schema.php:633

Error Info:
Array
(
[0] => 42S02
[1] => 1146
[2] => Table 'artengine.eav_attribute_value' doesn't exist
)

Stack trace:
#0 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\db\Command.php(854): yii\db\Schema->convertException(Object(PDOException), 'ALTER TABLE `ea...')
#1 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\db\Migration.php(427): yii\db\Command->execute()
#2 D:\OpenServer\domains\artengine.lh\vendor\mirocow\yii2-eav\src\migrations\m160711_132535_delete_foregin_key_from_values.php(12): yii\db\Migration->dropForeignKey('FK_Value_option...', 'eav_attribute_v...')
#3 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(509): m160711_132535_delete_foregin_key_from_values->up()
#4 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(130): yii\console\controllers\BaseMigrateController->migrateUp('m160711_132535_...')
#5 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#6 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\base\InlineAction.php(55): call_user_func_array(Array, Array)
#7 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\base\Controller.php(154): yii\base\InlineAction->runWithParams(Array)
#8 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\console\Controller.php(127): yii\base\Controller->runAction('up', Array)
#9 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\base\Module.php(454): yii\console\Controller->runAction('up', Array)
#10 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('migrate/up', Array)
#11 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('migrate/up', Array)
#12 D:\OpenServer\domains\artengine.lh\vendor\yiisoft\yii2\base\Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))
#13 D:\OpenServer\domains\artengine.lh\yii(28): yii\base\Application->run()
#14 {main}

@dukensk
Copy link
Author

dukensk commented Aug 11, 2016

Судя по всему, проблема из-за того, что таблицы в миграции m160711_132535_delete_foregin_key_from_values указаны не в иде {{%table_name}}, и при использовании префикса все падает.

@dukensk
Copy link
Author

dukensk commented Aug 11, 2016

Аналогичная проблема есть и в миграции m160711_162535_change_default_value

@dukensk
Copy link
Author

dukensk commented Aug 11, 2016

Проверил, так и есть. Отправил pull request.

@Mirocow
Copy link
Owner

Mirocow commented Aug 11, 2016

thx

@Mirocow Mirocow closed this as completed Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants