Add StudyGroups with ExternalUsers only
This commit is contained in:
13
db/migrate/20181122084546_create_study_groups.rb
Normal file
13
db/migrate/20181122084546_create_study_groups.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateStudyGroups < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :study_groups do |t|
|
||||
t.string :name
|
||||
t.string :external_id
|
||||
t.belongs_to :consumer
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :study_groups, [:external_id, :consumer_id], unique: true
|
||||
end
|
||||
end
|
||||
|
@@ -0,0 +1,8 @@
|
||||
class CreateStudyGroupMemberships < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :study_group_memberships do |t|
|
||||
t.belongs_to :study_group
|
||||
t.belongs_to :user, polymorphic: true
|
||||
end
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddStudyGroupToSubmission < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_reference :submissions, :study_group, index: true, null: true, foreign_key: true
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user