Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alembic_version has no primary key #406

Closed
sqlalchemy-bot opened this issue Jan 11, 2017 · 3 comments
Closed

alembic_version has no primary key #406

sqlalchemy-bot opened this issue Jan 11, 2017 · 3 comments

Comments

@sqlalchemy-bot
Copy link

@sqlalchemy-bot sqlalchemy-bot commented Jan 11, 2017

Migrated issue, originally created by Michael Bayer (@zzzeek)

It's odd that we don't put a simple PK on this table and databases like Galera recommend PKs on all tables, in the case of some Percona variant the database won't run on a table without a primary key.

The value itself is unique so we just make that a PK.

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Jan 11, 2017

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Jan 13, 2017

Michael Bayer (@zzzeek) wrote:

Add primary key constraint to alembic_version

The alembic_version table, when initially created, now establishes a
primary key constraint on the "version_num" column, to suit database
engines that don't support tables without primary keys. This behavior
can be controlled using the parameter
:paramref:.EnvironmentContext.configure.version_table_pk. Note that
this change only applies to the initial creation of the alembic_version
table; it does not impact any existing alembic_version table already
present.

Change-Id: Ic947f0f97373b2e6695e06c9b2ad6c8a9789fcb2
Fixes: #406

b57b164

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Jan 13, 2017

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.