Unless you provide a name, the constraint will be anonymously named, so
there is no difference between that and the shortcut.
Provide a name argument to UniqueConstraint:
__table_args__ = (UniqueConstraint('alt_id', name='uq_alt_id'),)
You may also be interested in providing a naming
You'll need to include questions for which there are no responses, so a
left outer join with an appropriate filter should help. Something like this
may point you in the right direction:
user_id = 4
session.query(Question).\
outerjoin(Response).\
filter(or_(
Response.id == None,
On Friday, January 31, 2014 7:45:07 AM UTC-7, Michael Bayer wrote:
On Jan 30, 2014, at 9:52 PM, Lucas Taylor ltaylo...@gmail.comjavascript:
wrote:
Any notion of how one might instruct SQLAlchemy to (conditionally) create
tables using UNLOGGED?
I'd like to be able to modify the DDL
Any notion of how one might instruct SQLAlchemy to (conditionally) create
tables using UNLOGGED?
I'd like to be able to modify the DDL for all CREATE TABLE statements under
certain conditions (dialect=postgresql testing=True)
If not under test, then there would be no need to modify CREATE