I have a case where adding a record to the following table definition
works great (and the PK auto increments nicely):

users_table = sa.Table("users", metadata,
    sa.Column("id", sa.Integer, primary_key = True),
    sa.Column("login", sa.String(40), nullable = False),
    sa.Column("password", sa.String(40), nullable = False),
<etc>

but then I realized I want that to be a composite PK with id and login
together, so I change the definition to this:

users_table = sa.Table("users", metadata,
    sa.Column("id", sa.Integer, primary_key = True, autoincrement =
True),
    sa.Column("login", sa.String(40), primary_key = True),
    sa.Column("password", sa.String(40), nullable = False),
<etc>

and now the autoincrement on id no longer works.  With the latter,
when I try and add a simple record that worked before I now get:

"IntegrityError: (IntegrityError) users.id may not be NULL u'INSERT
INTO users (login, password, <etc>"

I've tried sifting through the sqlite dialect to figure out what is
going on and have even tried forcing supports_pk_autoincrement to be
true, but it rapidly became clear I hadn't a clue what I was doing in
the sqlalchemy guts.

Does anyone know why autoincrement on "id" stopped working, and how I
can fix it?

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to