Skip to content

Instantly share code, notes, and snippets.

@acosonic
Created January 9, 2023 06:29
Show Gist options
  • Save acosonic/62d3aca8308da1d6d89731cb12786545 to your computer and use it in GitHub Desktop.
Save acosonic/62d3aca8308da1d6d89731cb12786545 to your computer and use it in GitHub Desktop.
Adding mysql auto increment primary key integer id field as first element to exiting table on the first place
ALTER TABLE somename ADD id int NOT NULL AUTO_INCREMENT primary key first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment