Before merging this pull request, we have to solve 3 problems:
Typing is not yet handled correctly, we have to wait for a new version of sqlalchemy-stubs (see dropbox/sqlalchemy-stubs#184).
Conflicts are not triggered by INSERT … ON CONFLICT … when None is set for a column with a default value set on the server (see a703487). It could be a bug in SQLAlchemy or a normal behavior. Removing the key from the request fixes the problem, but changes may also be needed somewhere else (where this corner case may not be tested).
Identities are now correctly handled by SQLAlchemy and Alembic (see d3577e6). In Azafea, PostgreSQL uses them when new tables are created with integer primary keys, instead of "SERIAL" (see model.py). As Alembic misses identities in the model but has them in the created table, it adds the identity in future migrations. That’s at least right for migration_event (which is created during tests and thus needs a fix to make them pass), but probably right for other tables too. Explicitly using identities everywhere should fix the problem, if we ever really need to fix it.
Fix #146.
Before merging this pull request, we have to solve 3 problems:
sqlalchemy-stubs
(see dropbox/sqlalchemy-stubs#184).INSERT … ON CONFLICT …
whenNone
is set for a column with a default value set on the server (see a703487). It could be a bug in SQLAlchemy or a normal behavior. Removing the key from the request fixes the problem, but changes may also be needed somewhere else (where this corner case may not be tested).model.py
). As Alembic misses identities in the model but has them in the created table, it adds the identity in future migrations. That’s at least right formigration_event
(which is created during tests and thus needs a fix to make them pass), but probably right for other tables too. Explicitly using identities everywhere should fix the problem, if we ever really need to fix it.