summaryrefslogtreecommitdiffstats
path: root/db/migrate/20151031095005_add_projects_default_version_id.rb
blob: 5a54715a739892aad20a563ab94ab77ebacbe5dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: false

class AddProjectsDefaultVersionId < ActiveRecord::Migration[4.2]
  def self.up
    # Don't try to add the column if redmine_default_version plugin was used
    unless column_exists?(:projects, :default_version_id, :integer)
      add_column :projects, :default_version_id, :integer, :default => nil
    end
  end

  def self.down
    remove_column :projects, :default_version_id
  end
end