Defect #5723 » db_migrate.patch
| db/migrate/027_create_wikis.rb (working copy) | ||
|---|---|---|
|
t.column :start_page, :string, :limit => 255, :null => false
|
||
|
t.column :status, :integer, :default => 1, :null => false
|
||
|
end
|
||
|
add_index :wikis, :project_id, :name => :wikis_project_id
|
||
|
add_index :wikis, :project_id, :name => "wikis_project_id"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/028_create_wiki_pages.rb (working copy) | ||
|---|---|---|
|
t.column :title, :string, :limit => 255, :null => false
|
||
|
t.column :created_on, :datetime, :null => false
|
||
|
end
|
||
|
add_index :wiki_pages, [:wiki_id, :title], :name => :wiki_pages_wiki_id_title
|
||
|
add_index :wiki_pages, [:wiki_id, :title], :name => "wiki_pages_wiki_id_title"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/029_create_wiki_contents.rb (working copy) | ||
|---|---|---|
|
t.column :updated_on, :datetime, :null => false
|
||
|
t.column :version, :integer, :null => false
|
||
|
end
|
||
|
add_index :wiki_contents, :page_id, :name => :wiki_contents_page_id
|
||
|
add_index :wiki_contents, :page_id, :name => "wiki_contents_page_id"
|
||
|
|
||
|
create_table :wiki_content_versions do |t|
|
||
|
t.column :wiki_content_id, :integer, :null => false
|
||
| ... | ... | |
|
t.column :updated_on, :datetime, :null => false
|
||
|
t.column :version, :integer, :null => false
|
||
|
end
|
||
|
add_index :wiki_content_versions, :wiki_content_id, :name => :wiki_content_versions_wcid
|
||
|
add_index :wiki_content_versions, :wiki_content_id, :name => "wiki_content_versions_wcid"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/032_create_time_entries.rb (working copy) | ||
|---|---|---|
|
t.column :created_on, :datetime, :null => false
|
||
|
t.column :updated_on, :datetime, :null => false
|
||
|
end
|
||
|
add_index :time_entries, [:project_id], :name => :time_entries_project_id
|
||
|
add_index :time_entries, [:issue_id], :name => :time_entries_issue_id
|
||
|
add_index :time_entries, [:project_id], :name => "time_entries_project_id"
|
||
|
add_index :time_entries, [:issue_id], :name => "time_entries_issue_id"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/034_create_changesets.rb (working copy) | ||
|---|---|---|
|
t.column :committed_on, :datetime, :null => false
|
||
|
t.column :comments, :text
|
||
|
end
|
||
|
add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev
|
||
|
add_index :changesets, [:repository_id, :revision], :unique => true, :name => "changesets_repos_rev"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/035_create_changes.rb (working copy) | ||
|---|---|---|
|
t.column :from_path, :string
|
||
|
t.column :from_revision, :integer
|
||
|
end
|
||
|
add_index :changes, [:changeset_id], :name => :changesets_changeset_id
|
||
|
add_index :changes, [:changeset_id], :name => "changesets_changeset_id"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/040_create_changesets_issues.rb (working copy) | ||
|---|---|---|
|
t.column :changeset_id, :integer, :null => false
|
||
|
t.column :issue_id, :integer, :null => false
|
||
|
end
|
||
|
add_index :changesets_issues, [:changeset_id, :issue_id], :unique => true, :name => :changesets_issues_ids
|
||
|
add_index :changesets_issues, [:changeset_id, :issue_id], :unique => true, :name => "changesets_issues_ids"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/045_create_boards.rb (working copy) | ||
|---|---|---|
|
t.column :messages_count, :integer, :default => 0, :null => false
|
||
|
t.column :last_message_id, :integer
|
||
|
end
|
||
|
add_index :boards, [:project_id], :name => :boards_project_id
|
||
|
add_index :boards, [:project_id], :name => "boards_project_id"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/046_create_messages.rb (working copy) | ||
|---|---|---|
|
t.column :created_on, :datetime, :null => false
|
||
|
t.column :updated_on, :datetime, :null => false
|
||
|
end
|
||
|
add_index :messages, [:board_id], :name => :messages_board_id
|
||
|
add_index :messages, [:parent_id], :name => :messages_parent_id
|
||
|
add_index :messages, [:board_id], :name => "messages_board_id"
|
||
|
add_index :messages, [:parent_id], :name => "messages_parent_id"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/066_add_custom_value_customized_index.rb (working copy) | ||
|---|---|---|
|
class AddCustomValueCustomizedIndex < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
add_index :custom_values, [:customized_type, :customized_id], :name => :custom_values_customized
|
||
|
add_index :custom_values, [:customized_type, :customized_id], :name => "custom_values_customized"
|
||
|
end
|
||
|
def self.down
|
||
|
remove_index :custom_values, :name => :custom_values_customized
|
||
|
remove_index :custom_values, :name => "custom_values_customized"
|
||
|
end
|
||
|
end
|
||
| db/migrate/067_create_wiki_redirects.rb (working copy) | ||
|---|---|---|
|
t.column :redirects_to, :string
|
||
|
t.column :created_on, :datetime, :null => false
|
||
|
end
|
||
|
add_index :wiki_redirects, [:wiki_id, :title], :name => :wiki_redirects_wiki_id_title
|
||
|
add_index :wiki_redirects, [:wiki_id, :title], :name => "wiki_redirects_wiki_id_title"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/068_create_enabled_modules.rb (working copy) | ||
|---|---|---|
|
t.column :project_id, :integer
|
||
|
t.column :name, :string, :null => false
|
||
|
end
|
||
|
add_index :enabled_modules, [:project_id], :name => :enabled_modules_project_id
|
||
|
add_index :enabled_modules, [:project_id], :name => "enabled_modules_project_id"
|
||
|
|
||
|
# Enable all modules for existing projects
|
||
|
Project.find(:all).each do |project|
|
||
| db/migrate/081_create_projects_trackers.rb (working copy) | ||
|---|---|---|
|
t.column :project_id, :integer, :default => 0, :null => false
|
||
|
t.column :tracker_id, :integer, :default => 0, :null => false
|
||
|
end
|
||
|
add_index :projects_trackers, :project_id, :name => :projects_trackers_project_id
|
||
|
add_index :projects_trackers, :project_id, :name => "projects_trackers_project_id"
|
||
|
|
||
|
# Associates all trackers to all projects (as it was before)
|
||
|
tracker_ids = Tracker.find(:all).collect(&:id)
|
||
| db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb (working copy) | ||
|---|---|---|
|
class AddRoleTrackerOldStatusIndexToWorkflows < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
add_index :workflows, [:role_id, :tracker_id, :old_status_id], :name => :wkfs_role_tracker_old_status
|
||
|
add_index :workflows, [:role_id, :tracker_id, :old_status_id], :name => "wkfs_role_tracker_old_status"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/20090214190337_add_watchers_user_id_type_index.rb (working copy) | ||
|---|---|---|
|
class AddWatchersUserIdTypeIndex < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
add_index :watchers, [:user_id, :watchable_type], :name => :watchers_user_id_type
|
||
|
add_index :watchers, [:user_id, :watchable_type], :name => "watchers_user_id_type"
|
||
|
end
|
||
|
def self.down
|
||
|
remove_index :watchers, :name => :watchers_user_id_type
|
||
|
remove_index :watchers, :name => "watchers_user_id_type"
|
||
|
end
|
||
|
end
|
||
| db/migrate/20090312194159_add_projects_trackers_unique_index.rb (working copy) | ||
|---|---|---|
|
class AddProjectsTrackersUniqueIndex < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
remove_duplicates
|
||
|
add_index :projects_trackers, [:project_id, :tracker_id], :name => :projects_trackers_unique, :unique => true
|
||
|
add_index :projects_trackers, [:project_id, :tracker_id], :name => "projects_trackers_unique", :unique => true
|
||
|
end
|
||
|
def self.down
|
||
|
remove_index :projects_trackers, :name => :projects_trackers_unique
|
||
|
remove_index :projects_trackers, :name => "projects_trackers_unique"
|
||
|
end
|
||
|
# Removes duplicates in projects_trackers table
|
||
| db/migrate/20090704172355_create_groups_users.rb (working copy) | ||
|---|---|---|
|
t.column :group_id, :integer, :null => false
|
||
|
t.column :user_id, :integer, :null => false
|
||
|
end
|
||
|
add_index :groups_users, [:group_id, :user_id], :unique => true, :name => :groups_users_ids
|
||
|
add_index :groups_users, [:group_id, :user_id], :unique => true, :name => "groups_users_ids"
|
||
|
end
|
||
|
def self.down
|
||
| db/migrate/20100221100219_add_index_on_changesets_scmid.rb (working copy) | ||
|---|---|---|
|
class AddIndexOnChangesetsScmid < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
add_index :changesets, [:repository_id, :scmid], :name => :changesets_repos_scmid
|
||
|
add_index :changesets, [:repository_id, :scmid], :name => "changesets_repos_scmid"
|
||
|
end
|
||
|
def self.down
|
||
|
remove_index :changesets, :name => :changesets_repos_scmid
|
||
|
remove_index :changesets, :name => "changesets_repos_scmid"
|
||
|
end
|
||
|
end
|
||