Pearlception_Website_RoR/Pearlception/db/migrate/20170210200122_create_runs.rb
Okechi Onyeje f06c2ca057 Mutltiple database pattern for companies integrated
- When creating a new company as an admin, a new database containing models for Runs, Grades, Results, Machines, and Oysters is migrated and created
- When a user registers, they are automatically switched to their company's db in the server
- When a user signs in they are also automatically swithched
2017-02-16 12:34:29 -05:00

17 lines
416 B
Ruby

class CreateRuns < ActiveRecord::Migration[5.0]
def change
create_table :runs do |t|
t.datetime :runDate, :null => false
t.string :location, limit: 50
t.string :harvest_time, limit: 50
t.string :supplier, limit: 50
t.string :distributor, limit: 50
t.string :other, limit: 50
t.integer :machine_id
t.timestamps
end
add_index :runs, :machine_id
end
end