I would like a database migration that is basically the following SQL:
ALTER TABLE `myTable` ADD COLUMN `id` INT AUTO_INCREMENT UNIQUE FIRST;
Is there a Sequel migration that does exactly this? I have gotten pretty close with the following, but it doesn't seem to be exactly what I want:
Sequel.migration do
change do
alter_table :my_table do
add_column :id, Bignum, null: false, unique: true
end
end
end
Specifically, it seems to be missing auto-increment and won't be the first column.
add_primary_key
instead ofadd_column
?