CakeDC / migrations

Migrations Plugin for CakePHP
http://cakedc.com
Other
344 stars 159 forks source link

acos, aros, aros_acos are added to migrations when i generate for Plugin Log #41

Closed simkimsia closed 12 years ago

simkimsia commented 12 years ago

I have this commit for Log Plugin

https://github.com/simkimsia/Log/commit/f0044c69d2d2a64cb99eeb78170491f7333dae7a

I added a new column to the logs table in the database.

Then i execute

cake20 Migrations.migration generate --plugin Log

then i choose compare with schema.php [Y]

the migrations is generated with the new column AND 3 tables acos, aros, aros_acos are also generated.

Question:

Is this a bug? if so, how do i temporarily fix it?

if not, then how do i prevent this?

simkimsia commented 12 years ago

currently, all i do is manually remove the up and down for the acos, etc tables in the next migration.

that is my workaround for time being.

skie commented 12 years ago

Script never can know what tables need to add. It just compare all schema tables with actual db state and generate db difference. So your cleanup approach is correct.