Skip to content
Snippets Groups Projects
Commit 779e95b5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge pull request #2401 from Philzen/4-0-stable

Fix for Postgresql Migration 3.1 --> 4.0
parents 2edb1661 91405d1f
No related branches found
No related tags found
4 merge requests!104094 0 stable,!2553Wiki grammar patch,!2439Documentation: don't setuid the repositories on installation,!2422updated instructions fixed up references of mysql and postgresql
This commit is part of merge request !10409. Comments created here will be created in the context of that merge request.
Loading
Loading
@@ -5,7 +5,7 @@ class MoveNoteableCommitToOwnField < ActiveRecord::Migration
Note.where(noteable_type: 'Commit').update_all('commit_id = noteable_id')
 
if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
Note.where("noteable_type != 'Commit'").update_all('new_noteable_id = CAST (noteable_id AS INTEGER)')
Note.where("noteable_type != 'Commit'").update_all('new_noteable_id = CAST (CASE noteable_id WHEN \'\' THEN NULL ELSE noteable_id END AS INTEGER)')
else
Note.where("noteable_type != 'Commit'").update_all('new_noteable_id = noteable_id')
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment