I'm looking to put a column at the front of my table I know you can do
add_column :customer, :first_name, after: :last_name
but is there a way to do :before
?
You're able to insert a column at the front of your table by using the :first
option:
add_column :table_name, :column_name, :column_type, first: true
You can still use :after
to handle all other positioning cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With