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

When using table prefix and run migration there is a bug #23

Closed
aminkt opened this issue Dec 24, 2017 · 0 comments
Closed

When using table prefix and run migration there is a bug #23

aminkt opened this issue Dec 24, 2017 · 0 comments

Comments

@aminkt
Copy link
Contributor

aminkt commented Dec 24, 2017

When i using table prefix to config database and run migrate tool i give below error:

applying m161109_104201_rename_setting_table
    > rename table {{%Setting}} to {{%setting}} ...Exception 'yii\db\Exception' with message 'SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'tbl_setting' already exists
The SQL being executed was: RENAME TABLE `tbl_Setting` TO `tbl_setting`'

in F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\db\Schema.php:594

Error Info:
Array
(
    [0] => 42S01
    [1] => 1050
    [2] => Table 'tbl_setting' already exists
)

Stack trace:
#0 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\db\Command.php(1004): yii\db\Schema->convertException(Object(PDOException), 'RENAME TABLE `t...')
#1 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\db\Migration.php(316): yii\db\Command->execute()
#2 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yii2mod\yii2-settings\migrations\m161109_104201_rename_setting_table.php(10): yii\db\Migration->renameTable('{{%Setting}}', '{{%setting}}')
#3 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(725): m161109_104201_rename_setting_table->up()
#4 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(199): yii\console\controllers\BaseMigrateController->migrateUp('m161109_104201_...')
#5 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#6 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#7 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#8 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\console\Controller.php(135): yii\base\Controller->runAction('', Array)
#9 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\base\Module.php(528): yii\console\Controller->runAction('', Array)
#10 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('migrate', Array)
#11 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('migrate', Array)
#12 F:\wamp64\www\projects\bitcoinbot\lib\vendor\yiisoft\yii2\base\Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#13 F:\wamp64\www\projects\bitcoinbot\lib\yii(27): yii\base\Application->run()
#14 {main}

To resolve that i send you an merge request. please accept it and publish it as soon as possible.

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