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

Already on GitHub? Sign in to your account

Refresh migration table schema #1911

Closed
mdeweerd opened this Issue Jan 1, 2013 · 4 comments

Comments

Contributor

mdeweerd commented Jan 1, 2013

I just ran into an issue running the migration command on an empty test database like this:

./yiic migrate --connectionID=testdb

As this is a test database, I empty it manually and try again until the base migration works.
Unfortunately, the schema caching is active. So on the second run, the MigrateCommand thought that the table already existed.

A minor improvement solves this: force schema refreshing for the table:

        protected function getMigrationHistory($limit)
        {
                $db=$this->getDbConnection();
                if($db->schema->getTable($this->migrationTable,true)===null)
Owner

samdark commented Jan 1, 2013

Have you tried 1.1.13?

Contributor

mdeweerd commented Jan 2, 2013

I am using version 1.1.12.
I could try this issue with 1.1.13 - I can't see why that would change the issue. If you think it's worth the try, I can do that.

However, it's just a matter of adding 'true' to the getTable call to resolve this.

Owner

samdark commented Jan 2, 2013

Re-checked. No need to check 1.1.13. The change I thought of is about Gii.

This one is related to #771

Contributor

mdeweerd commented Jan 2, 2013

Ok, thanks.

It is kind of to #771, but the issue I talk about is within Yii code for a Yii managed table.

@ghost ghost assigned cebe Jan 2, 2013

@cebe cebe closed this in 4ce94e9 May 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment