On Thu, Apr 12, 2012 at 10:39 PM, Michael Bayer <mike...@zzzcomputing.com> wrote: > > On Apr 12, 2012, at 4:18 AM, limodou wrote: > >> I also have other requirements: >> >> 1. if there is no changes should it can create nothing, not like this: >> >> def upgrade(): >> ### commands auto generated by Alembic - please adjust! ### >> pass >> ### end Alembic commands ### >> >> >> def downgrade(): >> ### commands auto generated by Alembic - please adjust! ### >> pass >> ### end Alembic commands ### > > that's what it should be doing what are you getting ?
But if I changed the database later, and I want to run revision command, and it'll tell me the datebase is not up to date. So I must run upgrade even though that will no effect at all. So I think it's tedious. So I think if there is no change at all, why not just say " The database is up to date, and don't create any revision file at all. If is this appoach better? > > >> >> 2. If I can merge the current changes into head revision, before I >> execute upgrade, so that I can combine several changes into one >> change. For me, I think just remove the head revision, and recreate >> new one that's ok. And only problem I think is that : if the user has >> manually changed the revision file, the changes will be lost. > > right, that's a problem, so easiest here is to just delete the head file > yourself and re-run autogenerate. Alembic isn't going to delete files nor > is it going to merge into an existing file - the first is too much of a > surprise, the second is far too complicated for this kind of tool. "KISS" > applies.... > So if it can be an option to let user to decide if he want to remove the head revision will be handful. User knows what they want to do. I just don't want to delete the file manually. -- I like python! UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/ UliWeb <<simple web framework>>: http://code.google.com/p/uliweb/ My Blog: http://hi.baidu.com/limodou -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.