Re: [sqlalchemy] Unique constraints disappearing

17 views
Skip to first unread message

Michael Bayer

unread,
Jun 17, 2013, 12:39:25 PM6/17/13
to sqlal...@googlegroups.com

On Jun 15, 2013, at 4:32 PM, Rj Ewing <ewin...@gmail.com> wrote:

> I am trying to do a migration and am running into a problem where my unique constraints are being delete with sqlite, but works fine with postgres.
>
> It seems that unique constraints are not present in the table, even before the migration.
>
> Ex.
>
> engine = create_engine("sqlite:///my.db")
> Session = sessionmaker(bind=engine)
> s = Session()
> metadata = MetaData(s.bind)
> t = Table('core__users', metadata, autoload=True, autoload_with=metadata.bind)
>
> t.constraints shows the pk constraint, but not the unique constraints.
>
> Is this a limitation with sqlite? Or am I doing something wrong?
>
> Any help is appreciated.

unique constraints are not currently reflected. This feature was just added in master and is currently set for release in 0.9.0.


Rj Ewing

unread,
Jun 21, 2013, 11:40:34 AM6/21/13
to sqlal...@googlegroups.com
great! thanks
Reply all
Reply to author
Forward
0 new messages