Skip to content

Instantly share code, notes, and snippets.

@aponcz
Created November 16, 2016 22:17
Show Gist options
  • Save aponcz/2b87d4700f3d3d15de0bc82cd15c5be6 to your computer and use it in GitHub Desktop.
Save aponcz/2b87d4700f3d3d15de0bc82cd15c5be6 to your computer and use it in GitHub Desktop.
create_table :policy_owners do |t|
t.integer :user_id
t.integer :policy_id
t.timestamps
end
create_table :policies do |t|
t.integer :policy_owner_id
t.string :number
t.integer :policy_type_id
t.integer :annual_premium_in_cents
t.integer :amount_due_in_cents
t.integer :installment_fee_in_cents
t.date :next_payment_date
t.date :effective_date
t.date :expiration_date
t.string :staus
t.string :symbol
t.string :carrier_id
t.string :insure_code
t.timestamps
end
create_table :vehicles do |t|
t.string :vin
t.integer :policy_id
t.timestamps
end
create_table :carriers do |t|
t.string :name, null: false
t.timestamps
end
create_table :policy_types do |t|
t.string :name, null: false
t.text :description
t.integer :insurance_class_id, null: false
t.timestamps
end
create_table :insurance_classes do |t|
t.string :name, null: false
t.text :description
t.timestamps
end
create_table :drivers do |t|
t.string :name
t.string :driver_license
t.date :license_expiration_date
t.string :address_line1
t.string :address_line2
t.string :city
t.string :state
t.string :zipcode
t.string :gender
t.date :dob
t.timstamps
end
create_table :policy_drivers do |t|
t.integer :driver_id, null: false
t.integer :policy_id, null: false
t.timstamps
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment