Skip to content

Commit

Permalink
remove index on assignments.integration_id
Browse files Browse the repository at this point in the history
It turns out the integration_id is not unique, and in addition,
is not used for lookup by SIS or pro serv.

Fixes SIS-287

Change-Id: Ie3a2e35fad064896d69fb980ba8103b0861f04c2
Reviewed-on: https://gerrit.instructure.com/35339
Tested-by: Jenkins <[email protected]>
Reviewed-by: Brian Palmer <[email protected]>
Product-Review: Brian Palmer <[email protected]>
QA-Review: Brian Palmer <[email protected]>
  • Loading branch information
Duane Johnson authored and maneframe committed May 23, 2014
1 parent d10232c commit 4fe29bd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 5 additions & 2 deletions db/migrate/20140404162351_add_assignment_post_columns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ def self.up
add_column :assignments, :post_to_sis, :boolean
add_column :assignments, :integration_id, :string

add_index :assignments, :integration_id, unique: true
# We used to add an index on integration_id here, but decided not
# to add it at all after it'd already been migrated in some envs
end

def self.down
remove_index :assignments, :integration_id
if index_exists?(:assignments, :integration_id)
remove_index :assignments, :integration_id
end

remove_column :assignments, :post_to_sis
remove_column :assignments, :integration_id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class RemoveAssignmentIntegrationIdIndex < ActiveRecord::Migration
tag :predeploy

def up
if index_exists?(:assignments, :integration_id)
remove_index :assignments, :integration_id
end
end

def down
end
end

0 comments on commit 4fe29bd

Please sign in to comment.