Skip to content

Instantly share code, notes, and snippets.

@doolin
Created December 22, 2022 14:10
Show Gist options
  • Save doolin/ef33e312d40b98c77d6a9214600fcf03 to your computer and use it in GitHub Desktop.
Save doolin/ef33e312d40b98c77d6a9214600fcf03 to your computer and use it in GitHub Desktop.
class Orders < ActiveRecord::Migration[7.0]
def change
create_table :orders do |t|
t.string :first_name # use Rails validations
t.string :last_name, null: false, limit: 128
end
end
end
Orders.migrate(:up) unless Orders.data_source_exists?(:orders)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment