Skip to content
Snippets Groups Projects
Commit 91405d1f authored by Phil. Austermann's avatar Phil. Austermann
Browse files

- Fix PostgreSql Migration issue to 4.0 (fixes https://github.com/gitlabhq/gitlabhq/issues/2398)

parent c68540e9
No related branches found
No related tags found
5 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,!2401Fix for Postgresql Migration 3.1 --> 4.0
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