Skip to content

Commit

Permalink
change backfill migration to just drop/add the column with default in…
Browse files Browse the repository at this point in the history
…stead

it's much faster with postgres >= 11

Change-Id: Iba90373eaf6622c7b0e048bf898a9eea0fa15ac6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260034
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
  • Loading branch information
ccutrer committed Mar 5, 2021
1 parent c40899d commit 7574f59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 37 deletions.
Expand Up @@ -17,16 +17,15 @@
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#

class AddRedoRequestToSubmissions < ActiveRecord::Migration[5.2]
tag :predeploy

def change
add_column :submissions, :redo_request, :boolean
change_column_default(:submissions, :redo_request, false)
def up
remove_column :submissions, :redo_request, if_exists: true
add_column :submissions, :redo_request, :boolean, default: false, null: false
end

def down
remove_column :submissions, :redo_request, :boolean
change_column_null(:submissions, :redo_request, true)
end
end
32 changes: 0 additions & 32 deletions db/migrate/20210127005857_backfill_submissions_redo_request.rb

This file was deleted.

0 comments on commit 7574f59

Please sign in to comment.