sqlalchemy / sqlalchemy/alembic
Handle AUTOINCREMENT modification detection in revision auto-generation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 375
- PR merge metrics
- No merged PRs in 30d
Description
Describe the use case
Unless I'm mistaken, toggling the autoincrement attribute of a table column is not detected by the revision auto-generation.
Databases / Backends / Drivers targeted
My usecase is for MySQL databases, but I guess it would be nice to have for any DB that supports this feature (although I'm not familiar with which DBs that would be).
Example Use
Migrate from
CREATE TABLE `FOO` (
`ID` int(11) NOT NULL,
PRIMARY KEY (`ID`)
);
to
CREATE TABLE `FOO` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`ID`)
);
would generate a difference in a migration script.
Have a nice day!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the MySQL example in revision auto-generation, comparing a table whose column lacks AUTO_INCREMENT with one that includes it. Trace how the schema difference is detected and confirm that the generated migration represents toggling the autoincrement attribute.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, python, sqlalchemy
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100