Pearlception_Website_RoR/Pearlception/db/migrate/20170210202948_create_oysters.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

18 lines
447 B
Ruby

class CreateOysters < ActiveRecord::Migration[5.0]
def change
create_table :oysters do |t|
t.integer :run_id, :null => false
t.string :grade, limit: 50, :null => false
t.column :volume, :double
t.column :length, :double
t.column :width, :double
t.column :height, :double
t.integer :machine_id
t.timestamps
end
add_index :oysters, :run_id
add_index :oysters, :machine_id
end
end