I am trying to design a schema for location attribute in my rails application.
Should this be the right design
class CreateLocations < ActiveRecord::Migration
def self.up
create_table :locations do |t|
t.string :zip
t.string :city, :null => false
t.string :state, :null => false
t.string :country, :null => false
t.string :latitude
t.string :longitude
t.timestamps
end
end
end
unless there is a particular reason you don’t think this is solving your solution, syntactically it looks right to me. the beauty of rails is that if it isnt right you can migrate the data model to add more attributes as you find you need them.