Skip to content

Commit

Permalink
Fix for postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
godfat committed Mar 14, 2017
1 parent 67729ce commit 0b20d85
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions db/migrate/20161201160452_migrate_project_statistics.rb
Expand Up @@ -17,7 +17,7 @@ def up
end

def down
add_column_with_default :projects, :repository_size, :float, default: 0.0
add_column_with_default :projects, :commit_count, :integer, default: 0
add_column :projects, :repository_size, :float, default: 0.0
add_column :projects, :commit_count, :integer, default: 0
end
end
Expand Up @@ -17,6 +17,6 @@ def up
def down
return unless Gitlab::Database.postgresql?

remove_index :routes, name: :index_on_routes_lower_path
remove_index :routes, name: :index_on_routes_lower_path if index_exists?(:routes, name: :index_on_routes_lower_path)
end
end
Expand Up @@ -8,4 +8,8 @@ class AddIndexToProjectAuthorizations < ActiveRecord::Migration
def up
add_concurrent_index(:project_authorizations, :project_id)
end

def down
remove_index(:project_authorizations, :project_id)
end
end
6 changes: 5 additions & 1 deletion db/migrate/20170305203726_add_owner_id_foreign_key.rb
Expand Up @@ -5,7 +5,11 @@ class AddOwnerIdForeignKey < ActiveRecord::Migration

disable_ddl_transaction!

def change
def up
add_concurrent_foreign_key :ci_triggers, :users, column: :owner_id, on_delete: :cascade
end

def down
remove_foreign_key :ci_triggers, column: :owner_id
end
end

0 comments on commit 0b20d85

Please sign in to comment.