On Fri, Apr 13, 2012 at 8:48 AM, Michael Bayer <[email protected]> wrote: > > On Apr 12, 2012, at 8:07 PM, limodou wrote: > >> >> For example, in my case, when I made some changes and I want to test >> them, so I can run "revision --autogenerate" and "upgrade" the >> database. And then I made other changes, and do the cycle again I can >> do this way. But sometimes I just change the model and run "revision >> --autogenerate" and don't upgrade the database, and I also made other >> changes, and I want to merge two changes into one piece, so I just >> want to delete the lastest revision, and re autogenerate the revision. >> So if the alembic can delete the head revision script for me, I don't >> need to delete it manually. That's what I think. > > i think if people wanted anything, they'd want it to append to the file > that's already there....or just add another new migration file. I'd never > want it to delete....
So this thing I think is migrate, but I thought it's harder than just delete the un upgraded scripts and re autogenerate the revision. So I think deletion is just a simple way. If there is better appoach will be better. > > i know what you mean, you generate the rev, then keep doing other things > before running upgrade. but for that to really do "what I want", > autogenerate would need to keep a list of what it already autogenerated, and > is still pending, then add new migrations onto that. which implies it's > keeping a datafile somewhere, or in the last migration file. which starts > getting too complicated, and kind of redundant. > > I think really, just running upgrade is the answer - you can always downgrade > again to test ! > > if more people start complaining about this issue maybe we'll come up with > something else... > So I think "rm" command will satisfy me now. And I think autogenerate is more handful, and for simple situation, I really know what I've made and don't need autogenerate to worry about for me. So that's what I need. And so I think "rm" can do the work. And if the rm command can remove all un upgraded revision is better, so I don't need to give "rev:head" parameter, because I need to check which is the first rev that un upgraded yet. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
