-
Notifications
You must be signed in to change notification settings - Fork 89
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
Added :rename-to and :rename-column-to for :alter-table #131
Conversation
(sql (:alter-table "mytable" :rename-to "newtable"))
"ALTER TABLE mytable RENAME TO newtable"
(sql (:alter-table :my-table :rename-to :new-table))
"ALTER TABLE my_table RENAME TO new_table" |
I would request that your patch handle renaming a column as well as renaming the table itself. |
Would you also accept something like alter-sequence function: https://gist.github.com/knobo/6beb0ab71b8bbe182afc5ffee5b7e69f#file-s-sql-lisp |
(with-schema ("testing_rename" :drop-after t) (query (:create-table :testing ((:main :type int :primary-key t)))) (query (:alter-table :testing :rename-column-to :main :id)) (query (:alter-table :testing :rename-to :success)) (table-description :success))
Do you have any suggestion on :rename-to, maybe it should be :rename-table-to? |
To test it: (with-schema ("testing_rename" :drop-after t)
(query (:create-table :testing ((:main :type int :primary-key t))))
(query (:alter-table :testing :rename-column-to :main :id))
(query (:alter-table :testing :rename-to :success))
(table-description :success)) |
Maybe it should be :rename and :rename-column, and skip the "-to" part? |
I am comfortable with :rename and :rename-column |
Your requested additions have been included in the most recent update. |
No description provided.