mirror of
https://github.com/oonyeje/Pearlception_Website_RoR.git
synced 2025-12-25 11:47:41 +00:00
- 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
24 lines
635 B
Ruby
24 lines
635 B
Ruby
class CreateResults < ActiveRecord::Migration[5.0]
|
|
def change
|
|
create_table :results do |t|
|
|
t.column :total, :integer , :null => false
|
|
t.column :grade1, :integer
|
|
t.column :grade2, :integer
|
|
t.column :grade3, :integer
|
|
t.column :grade4, :integer
|
|
t.column :grade5, :integer
|
|
t.column :grade6, :integer
|
|
t.column :grade7, :integer
|
|
t.column :grade8, :integer
|
|
t.column :grade9, :integer
|
|
t.column :grade10, :integer
|
|
t.integer :machine_id
|
|
t.integer :run_id
|
|
|
|
t.timestamps
|
|
end
|
|
add_index :results, :machine_id
|
|
add_index :results, :run_id
|
|
end
|
|
end
|