Project

General

Profile

Defect #5723 » db_migrate.patch

DB migrate patch for rails 2.3.8 - Mike Stupalov, 2010-06-22 13:40

View differences:

db/migrate/027_create_wikis.rb (working copy)
5 5
      t.column :start_page, :string,  :limit => 255, :null => false
6 6
      t.column :status, :integer, :default => 1, :null => false
7 7
    end    
8
    add_index :wikis, :project_id, :name => :wikis_project_id
8
    add_index :wikis, :project_id, :name => "wikis_project_id"
9 9
  end
10 10

  
11 11
  def self.down
db/migrate/028_create_wiki_pages.rb (working copy)
5 5
      t.column :title, :string, :limit => 255, :null => false
6 6
      t.column :created_on, :datetime, :null => false    
7 7
    end
8
    add_index :wiki_pages, [:wiki_id, :title], :name => :wiki_pages_wiki_id_title
8
    add_index :wiki_pages, [:wiki_id, :title], :name => "wiki_pages_wiki_id_title"
9 9
  end
10 10

  
11 11
  def self.down
db/migrate/029_create_wiki_contents.rb (working copy)
8 8
      t.column :updated_on, :datetime, :null => false
9 9
      t.column :version, :integer, :null => false
10 10
    end
11
    add_index :wiki_contents, :page_id, :name => :wiki_contents_page_id
11
    add_index :wiki_contents, :page_id, :name => "wiki_contents_page_id"
12 12
    
13 13
    create_table :wiki_content_versions do |t|
14 14
      t.column :wiki_content_id, :integer, :null => false
......
20 20
      t.column :updated_on, :datetime, :null => false
21 21
      t.column :version, :integer, :null => false
22 22
    end
23
    add_index :wiki_content_versions, :wiki_content_id, :name => :wiki_content_versions_wcid
23
    add_index :wiki_content_versions, :wiki_content_id, :name => "wiki_content_versions_wcid"
24 24
  end
25 25

  
26 26
  def self.down
db/migrate/032_create_time_entries.rb (working copy)
14 14
      t.column :created_on,  :datetime, :null => false
15 15
      t.column :updated_on,  :datetime, :null => false
16 16
    end
17
    add_index :time_entries, [:project_id], :name => :time_entries_project_id
18
    add_index :time_entries, [:issue_id], :name => :time_entries_issue_id
17
    add_index :time_entries, [:project_id], :name => "time_entries_project_id"
18
    add_index :time_entries, [:issue_id], :name => "time_entries_issue_id"
19 19
  end
20 20

  
21 21
  def self.down
db/migrate/034_create_changesets.rb (working copy)
7 7
      t.column :committed_on, :datetime, :null => false
8 8
      t.column :comments, :text
9 9
    end
10
    add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev
10
    add_index :changesets, [:repository_id, :revision], :unique => true, :name => "changesets_repos_rev"
11 11
  end
12 12

  
13 13
  def self.down
db/migrate/035_create_changes.rb (working copy)
7 7
      t.column :from_path, :string
8 8
      t.column :from_revision, :integer
9 9
    end
10
    add_index :changes, [:changeset_id], :name => :changesets_changeset_id
10
    add_index :changes, [:changeset_id], :name => "changesets_changeset_id"
11 11
  end
12 12

  
13 13
  def self.down
db/migrate/040_create_changesets_issues.rb (working copy)
4 4
      t.column :changeset_id, :integer, :null => false
5 5
      t.column :issue_id, :integer, :null => false
6 6
    end
7
    add_index :changesets_issues, [:changeset_id, :issue_id], :unique => true, :name => :changesets_issues_ids
7
    add_index :changesets_issues, [:changeset_id, :issue_id], :unique => true, :name => "changesets_issues_ids"
8 8
  end
9 9

  
10 10
  def self.down
db/migrate/045_create_boards.rb (working copy)
9 9
      t.column :messages_count, :integer, :default => 0, :null => false
10 10
      t.column :last_message_id, :integer
11 11
    end
12
    add_index :boards, [:project_id], :name => :boards_project_id
12
    add_index :boards, [:project_id], :name => "boards_project_id"
13 13
  end
14 14

  
15 15
  def self.down
db/migrate/046_create_messages.rb (working copy)
11 11
      t.column :created_on, :datetime, :null => false
12 12
      t.column :updated_on, :datetime, :null => false
13 13
    end
14
    add_index :messages, [:board_id], :name => :messages_board_id
15
    add_index :messages, [:parent_id], :name => :messages_parent_id
14
    add_index :messages, [:board_id], :name => "messages_board_id"
15
    add_index :messages, [:parent_id], :name => "messages_parent_id"
16 16
  end
17 17

  
18 18
  def self.down
db/migrate/066_add_custom_value_customized_index.rb (working copy)
1 1
class AddCustomValueCustomizedIndex < ActiveRecord::Migration
2 2
  def self.up
3
    add_index :custom_values, [:customized_type, :customized_id], :name => :custom_values_customized
3
    add_index :custom_values, [:customized_type, :customized_id], :name => "custom_values_customized"
4 4
  end
5 5

  
6 6
  def self.down
7
    remove_index :custom_values, :name => :custom_values_customized
7
    remove_index :custom_values, :name => "custom_values_customized"
8 8
  end
9 9
end
db/migrate/067_create_wiki_redirects.rb (working copy)
6 6
      t.column :redirects_to, :string
7 7
      t.column :created_on, :datetime, :null => false
8 8
    end
9
    add_index :wiki_redirects, [:wiki_id, :title], :name => :wiki_redirects_wiki_id_title
9
    add_index :wiki_redirects, [:wiki_id, :title], :name => "wiki_redirects_wiki_id_title"
10 10
  end
11 11

  
12 12
  def self.down
db/migrate/068_create_enabled_modules.rb (working copy)
4 4
      t.column :project_id, :integer
5 5
      t.column :name, :string, :null => false
6 6
    end
7
    add_index :enabled_modules, [:project_id], :name => :enabled_modules_project_id
7
    add_index :enabled_modules, [:project_id], :name => "enabled_modules_project_id"
8 8
    
9 9
    # Enable all modules for existing projects
10 10
    Project.find(:all).each do |project|
db/migrate/081_create_projects_trackers.rb (working copy)
4 4
      t.column :project_id, :integer, :default => 0, :null => false
5 5
      t.column :tracker_id, :integer, :default => 0, :null => false
6 6
    end
7
    add_index :projects_trackers, :project_id, :name => :projects_trackers_project_id
7
    add_index :projects_trackers, :project_id, :name => "projects_trackers_project_id"
8 8
    
9 9
    # Associates all trackers to all projects (as it was before)
10 10
    tracker_ids = Tracker.find(:all).collect(&:id)
db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb (working copy)
1 1
class AddRoleTrackerOldStatusIndexToWorkflows < ActiveRecord::Migration
2 2
  def self.up
3
    add_index :workflows, [:role_id, :tracker_id, :old_status_id], :name => :wkfs_role_tracker_old_status
3
    add_index :workflows, [:role_id, :tracker_id, :old_status_id], :name => "wkfs_role_tracker_old_status"
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/20090214190337_add_watchers_user_id_type_index.rb (working copy)
1 1
class AddWatchersUserIdTypeIndex < ActiveRecord::Migration
2 2
  def self.up
3
    add_index :watchers, [:user_id, :watchable_type], :name => :watchers_user_id_type
3
    add_index :watchers, [:user_id, :watchable_type], :name => "watchers_user_id_type"
4 4
  end
5 5

  
6 6
  def self.down
7
    remove_index :watchers, :name => :watchers_user_id_type
7
    remove_index :watchers, :name => "watchers_user_id_type"
8 8
  end
9 9
end
db/migrate/20090312194159_add_projects_trackers_unique_index.rb (working copy)
1 1
class AddProjectsTrackersUniqueIndex < ActiveRecord::Migration
2 2
  def self.up
3 3
    remove_duplicates
4
    add_index :projects_trackers, [:project_id, :tracker_id], :name => :projects_trackers_unique, :unique => true
4
    add_index :projects_trackers, [:project_id, :tracker_id], :name => "projects_trackers_unique", :unique => true
5 5
  end
6 6

  
7 7
  def self.down
8
    remove_index :projects_trackers, :name => :projects_trackers_unique
8
    remove_index :projects_trackers, :name => "projects_trackers_unique"
9 9
  end
10 10

  
11 11
  # Removes duplicates in projects_trackers table
db/migrate/20090704172355_create_groups_users.rb (working copy)
4 4
      t.column :group_id, :integer, :null => false
5 5
      t.column :user_id, :integer, :null => false
6 6
    end
7
    add_index :groups_users, [:group_id, :user_id], :unique => true, :name => :groups_users_ids
7
    add_index :groups_users, [:group_id, :user_id], :unique => true, :name => "groups_users_ids"
8 8
  end
9 9

  
10 10
  def self.down
db/migrate/20100221100219_add_index_on_changesets_scmid.rb (working copy)
1 1
class AddIndexOnChangesetsScmid < ActiveRecord::Migration
2 2
  def self.up
3
    add_index :changesets, [:repository_id, :scmid], :name => :changesets_repos_scmid
3
    add_index :changesets, [:repository_id, :scmid], :name => "changesets_repos_scmid"
4 4
  end
5 5

  
6 6
  def self.down
7
    remove_index :changesets, :name => :changesets_repos_scmid
7
    remove_index :changesets, :name => "changesets_repos_scmid"
8 8
  end
9 9
end
(1-1/2)