-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
db/Schema::getTableMetadata() broken #15117
Comments
Em. The current implementation should work fine because it discards a complete table metadata if |
What's the database used? MySQL? |
Yes, MySQL. |
No, it does not work "fine". use yii\console\controllers\MigrateController,
yii\db\Connection,
yii\db\Schema,
yii\db\TableSchema;
But I suppose a solution would involve tuning table prefix resolution for schema caching and/or migrations. |
@U-D13 thanks for details. It's definitely not okay. |
I confirm this. |
This error is still present in the latest version. Running |
What steps will reproduce the problem?
Run migrate/fresh more than once.
What is the expected result?
Command should run on each call.
What do you get instead?
On second call an exception is thrown because the migration table gets not created after truncate.
Additional info
The error was introduced in Yii 2.0.13.
The reason is the implementation of db/Schema::getTableMetadata(). The migration table does not exist but it's schema information are still present in file cache.
This is the current implementation:
And it should look like this:
The text was updated successfully, but these errors were encountered: