parent
f0d41767e7
commit
c389f0f2a6
@ -0,0 +1,3 @@
|
||||
class SchoolDailyActiveUser < ActiveRecord::Base
|
||||
belongs_to :school_daily_report
|
||||
end
|
@ -1,3 +1,5 @@
|
||||
class SchoolDailyReport < ActiveRecord::Base
|
||||
belongs_to :school
|
||||
|
||||
has_many :school_daily_active_users, dependent: :delete_all
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class CreateSchoolDailyActiveUsers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :school_daily_active_users do |t|
|
||||
t.integer :school_daily_report_id
|
||||
t.integer :user_id
|
||||
end
|
||||
|
||||
add_index :school_daily_active_users, :school_daily_report_id
|
||||
end
|
||||
end
|
Loading…
Reference in new issue