rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.24k stars 280 forks source link

Request: Update go-sqlite3 dependency to latest (1.14.14) #222

Closed asartalo closed 2 years ago

asartalo commented 2 years ago

Hi. SQLite3 starting from 3.35.x supports DROP COLUMN syntax and this comes with the latest go-sqlite3. Right now, sql-migrate uses go-sqlite3 version 1.14.6 which uses sqlite 3.34.x. It would really help making migrations with inserting/removing columns easier instead of the cumbersome method like what's written here: https://stackoverflow.com/questions/8442147/how-to-delete-or-add-column-in-sqlite

  1. create new table as the one you are trying to change,
  2. copy all data,
  3. drop old table,
  4. rename the new one.
rubenv commented 2 years ago

Sounds good, could you make a PR?

On Wed, Sep 7, 2022, 06:19 Wayne Duran @.***> wrote:

Hi. SQLite3 starting from 3.35.x supports DROP COLUMN syntax and this comes with the latest go-sqlite3. Right now, sql-migrate uses go-sqlite3 version 1.14.6 which uses sqlite 3.34.x. It would really help making migrations with inserting/removing columns easier instead of the cumbersome method like what's written here: https://stackoverflow.com/questions/8442147/how-to-delete-or-add-column-in-sqlite

  1. create new table as the one you are trying to change,
  2. copy all data,
  3. drop old table,
  4. rename the new one.

— Reply to this email directly, view it on GitHub https://github.com/rubenv/sql-migrate/issues/222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAKPGFCCAYBIUS2R2N3B63V5AJU3ANCNFSM6AAAAAAQGMKA54 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

asartalo commented 2 years ago

Sure! Here it is: #223

rubenv commented 2 years ago

Merged and released as v1.2.0. Bumped the minor as this may incur compatibility breaks (in case someone has other tooling that's SQLite 3.34 based).

Thanks a lot!