support for Sequence in create_all
Issue #1565
resolved
A Sequence defined outside of a table definition (that is bound using the metadata keyword) is not created when the metadata's create_all method is called. Why is this a problem, why not just put the sequence definition in the table? Giving the same column a default value (for example, that of calling the sequence's execute method / nextval) appears to cause SQLA to ignore the sequence. This is useful for when a sequence is being used by more than one table. Fixing the create_all issue is a more elegant solution than fixing the default issue, and perhaps the latter is intended behaviour.
Comments (3)
-
Account Deleted -
repo owner you can do this in 0.6 via:
CreateSequence(some_sequence).execute_at("after-create", metadata)
-
repo owner - removed milestone
Removing milestone: 0.6.0 (automated comment)
- Log in to comment
Just happened to glance around and saw
#1563, I hadn't thought to try using server_default (which actually makes more sense) so the problem is resolved. I think it'd still be nice to be able to create the sequence with create_all though!