Is there any way to check whether the table exists or not before
dropping it?

if A.table.exists():




On Aug 20, 7:02 pm, "Gaetan de Menten" <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 20, 2008 at 10:18 AM, Victor Lin <[EMAIL PROTECTED]> wrote:
> > I want to drop specifictabledeclared by elixir.
> > I found that I can't drop it just like this:
>
> >table.drop()
>
> > There is no such a method "drop".
>
> Sure there is... on thetable(not on the Entity):
> given an entity:
>
> class A(Entity):
>     pass
> setup_all()
> create_all()
>
> A.table.drop() works fine here.
>
> > I know there is a "drop_all" method, but the only thing I want to do
> > is drop one, not all.
> > I think methods like drop should be easy done as sqlalchemy is.
>
> > So the question is, how to drop atableand recreate it?
>
> A.table.drop()
> A.table.create()
>
> But keep in mind it probably (at least I suppose) won't work if you
> have other tables with references to thetableyou drop.
>
> --
> Gaëtan de Mentenhttp://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to