Project

General

Profile

Patch #29424 » convert_db.diff

Enziin System, 2018-08-22 13:37

View differences:

db/migrate/001_setup.rb (working copy)
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Setup < ActiveRecord::Migration[4.2]
class Setup < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
end
......
class Permission < ActiveRecord::Base; end
def self.up
create_table "attachments", :force => true do |t|
t.column "container_id", :integer, :default => 0, :null => false
t.column "container_type", :string, :limit => 30, :default => "", :null => false
t.column "filename", :string, :default => "", :null => false
t.column "disk_filename", :string, :default => "", :null => false
t.column "filesize", :integer, :default => 0, :null => false
t.column "content_type", :string, :limit => 60, :default => ""
t.column "digest", :string, :limit => 40, :default => "", :null => false
t.column "downloads", :integer, :default => 0, :null => false
t.column "author_id", :integer, :default => 0, :null => false
t.column "created_on", :timestamp
create_table :attachments, force: true do |t|
t.bigint :container_id, default: 0, null: false
t.string :container_type, limit: 30, default: "", null: false
t.string :filename, default: "", null: false
t.string :disk_filename, default: "", null: false
t.integer :filesize, default: 0, null: false
t.string :content_type, limit: 60, default: ""
t.string :digest, limit: 40, default: "", null: false
t.bigint :downloads, default: 0, null: false
t.bigint :author_id, default: 0, null: false
t.datetime :created_on
end
create_table "auth_sources", :force => true do |t|
t.column "type", :string, :limit => 30, :default => "", :null => false
t.column "name", :string, :limit => 60, :default => "", :null => false
t.column "host", :string, :limit => 60
t.column "port", :integer
t.column "account", :string, :limit => 60
t.column "account_password", :string, :limit => 60
t.column "base_dn", :string, :limit => 255
t.column "attr_login", :string, :limit => 30
t.column "attr_firstname", :string, :limit => 30
t.column "attr_lastname", :string, :limit => 30
t.column "attr_mail", :string, :limit => 30
t.column "onthefly_register", :boolean, :default => false, :null => false
create_table :auth_sources, force: true do |t|
t.string :type, limit: 30, default: "", null: false
t.string :name, limit: 60, default: "", null: false
t.string :host, limit: 60
t.integer :port
t.string :account, limit: 60
t.string :account_password, limit: 60
t.string :base_dn, limit: 255
t.string :attr_login, limit: 30
t.string :attr_firstname, limit: 30
t.string :attr_lastname, limit: 30
t.string :attr_mail, limit: 30
t.boolean :onthefly_register, default: false, null: false
end
create_table "custom_fields", :force => true do |t|
t.column "type", :string, :limit => 30, :default => "", :null => false
t.column "name", :string, :limit => 30, :default => "", :null => false
t.column "field_format", :string, :limit => 30, :default => "", :null => false
t.column "possible_values", :text
t.column "regexp", :string, :default => ""
t.column "min_length", :integer, :default => 0, :null => false
t.column "max_length", :integer, :default => 0, :null => false
t.column "is_required", :boolean, :default => false, :null => false
t.column "is_for_all", :boolean, :default => false, :null => false
create_table :custom_fields, force: true do |t|
t.string :type, limit: 30, default: "", null: false
t.string :name, limit: 30, default: "", null: false
t.string :field_format, limit: 30, default: "", null: false
t.text :possible_values
t.string :regexp, default: ""
t.integer :min_length, default: 0, null: false
t.integer :max_length, default: 0, null: false
t.boolean :is_required, default: false, null: false
t.boolean :is_for_all, default: false, null: false
end
create_table "custom_fields_projects", :id => false, :force => true do |t|
t.column "custom_field_id", :integer, :default => 0, :null => false
t.column "project_id", :integer, :default => 0, :null => false
create_table :custom_fields_projects, :id => false, force: true do |t|
t.bigint :custom_field_id, default: 0, null: false
t.bigint :project_id, default: 0, null: false
end
create_table "custom_fields_trackers", :id => false, :force => true do |t|
t.column "custom_field_id", :integer, :default => 0, :null => false
t.column "tracker_id", :integer, :default => 0, :null => false
create_table :custom_fields_trackers, :id => false, force: true do |t|
t.bigint :custom_field_id, default: 0, null: false
t.bigint :tracker_id, default: 0, null: false
end
create_table "custom_values", :force => true do |t|
t.column "customized_type", :string, :limit => 30, :default => "", :null => false
t.column "customized_id", :integer, :default => 0, :null => false
t.column "custom_field_id", :integer, :default => 0, :null => false
t.column "value", :text
create_table :custom_values, force: true do |t|
t.string :customized_type, limit: 30, default: "", null: false
t.bigint :customized_id, default: 0, null: false
t.bigint :custom_field_id, default: 0, null: false
t.text :value
end
create_table "documents", :force => true do |t|
t.column "project_id", :integer, :default => 0, :null => false
t.column "category_id", :integer, :default => 0, :null => false
t.column "title", :string, :limit => 60, :default => "", :null => false
t.column "description", :text
t.column "created_on", :timestamp
create_table :documents, force: true do |t|
t.bigint :project_id, default: 0, null: false
t.bigint :category_id, default: 0, null: false
t.string :title, limit: 60, default: "", null: false
t.text :description
t.datetime :created_on
end
add_index "documents", ["project_id"], :name => "documents_project_id"
create_table "enumerations", :force => true do |t|
t.column "opt", :string, :limit => 4, :default => "", :null => false
t.column "name", :string, :limit => 30, :default => "", :null => false
create_table :enumerations, force: true do |t|
t.string :opt, limit: 4, default: "", null: false
t.string :name, limit: 30, default: "", null: false
end
create_table "issue_categories", :force => true do |t|
t.column "project_id", :integer, :default => 0, :null => false
t.column "name", :string, :limit => 30, :default => "", :null => false
create_table :issue_categories, force: true do |t|
t.bigint :project_id, default: 0, null: false
t.string :name, limit: 30, default: "", null: false
end
add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id"
create_table "issue_histories", :force => true do |t|
t.column "issue_id", :integer, :default => 0, :null => false
t.column "status_id", :integer, :default => 0, :null => false
t.column "author_id", :integer, :default => 0, :null => false
t.column "notes", :text
t.column "created_on", :timestamp
create_table :issue_histories, force: true do |t|
t.bigint :issue_id, default: 0, null: false
t.bigint :status_id, default: 0, null: false
t.bigint :author_id, default: 0, null: false
t.text :notes
t.datetime :created_on
end
add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
create_table "issue_statuses", :force => true do |t|
t.column "name", :string, :limit => 30, :default => "", :null => false
t.column "is_closed", :boolean, :default => false, :null => false
t.column "is_default", :boolean, :default => false, :null => false
t.column "html_color", :string, :limit => 6, :default => "FFFFFF", :null => false
create_table :issue_statuses, force: true do |t|
t.string :name, limit: 30, default: "", null: false
t.boolean :is_closed, default: false, null: false
t.boolean :is_default, default: false, null: false
t.string :html_color, limit: 6, default: "FFFFFF", null: false
end
create_table "issues", :force => true do |t|
t.column "tracker_id", :integer, :default => 0, :null => false
t.column "project_id", :integer, :default => 0, :null => false
t.column "subject", :string, :default => "", :null => false
t.column "description", :text
t.column "due_date", :date
t.column "category_id", :integer
t.column "status_id", :integer, :default => 0, :null => false
t.column "assigned_to_id", :integer
t.column "priority_id", :integer, :default => 0, :null => false
t.column "fixed_version_id", :integer
t.column "author_id", :integer, :default => 0, :null => false
t.column "lock_version", :integer, :default => 0, :null => false
t.column "created_on", :timestamp
t.column "updated_on", :timestamp
create_table :issues, force: true do |t|
t.bigint :tracker_id, default: 0, null: false
t.bigint :project_id, default: 0, null: false
t.string :subject, default: "", null: false
t.text :description
t.date "due_date"
t.bigint :category_id
t.bigint :status_id, default: 0, null: false
t.bigint :assigned_to_id
t.bigint :priority_id, default: 0, null: false
t.bigint :fixed_version_id
t.bigint :author_id, default: 0, null: false
t.integer :lock_version, default: 0, null: false
t.datetime :created_on
t.datetime :updated_on
end
add_index "issues", ["project_id"], :name => "issues_project_id"
create_table "members", :force => true do |t|
t.column "user_id", :integer, :default => 0, :null => false
t.column "project_id", :integer, :default => 0, :null => false
t.column "role_id", :integer, :default => 0, :null => false
t.column "created_on", :timestamp
create_table :members, force: true do |t|
t.bigint :user_id, default: 0, null: false
t.bigint :project_id, default: 0, null: false
t.bigint :role_id, default: 0, null: false
t.datetime :created_on
end
create_table "news", :force => true do |t|
t.column "project_id", :integer
t.column "title", :string, :limit => 60, :default => "", :null => false
t.column "summary", :string, :limit => 255, :default => ""
t.column "description", :text
t.column "author_id", :integer, :default => 0, :null => false
t.column "created_on", :timestamp
create_table :news, force: true do |t|
t.bigint :project_id
t.string :title, limit: 60, default: "", null: false
t.string :summary, limit: 255, default: ""
t.text :description
t.bigint :author_id, default: 0, null: false
t.datetime :created_on
end
add_index "news", ["project_id"], :name => "news_project_id"
create_table "permissions", :force => true do |t|
t.column "controller", :string, :limit => 30, :default => "", :null => false
t.column "action", :string, :limit => 30, :default => "", :null => false
t.column "description", :string, :limit => 60, :default => "", :null => false
t.column "is_public", :boolean, :default => false, :null => false
t.column "sort", :integer, :default => 0, :null => false
t.column "mail_option", :boolean, :default => false, :null => false
t.column "mail_enabled", :boolean, :default => false, :null => false
create_table :permissions, force: true do |t|
t.string :controller, limit: 30, default: "", null: false
t.string :action, limit: 30, default: "", null: false
t.string :description, limit: 60, default: "", null: false
t.boolean :is_public, default: false, null: false
t.integer :sort, default: 0, null: false
t.boolean :mail_option, default: false, null: false
t.boolean :mail_enabled, default: false, null: false
end
create_table "permissions_roles", :id => false, :force => true do |t|
t.column "permission_id", :integer, :default => 0, :null => false
t.column "role_id", :integer, :default => 0, :null => false
create_table :permissions_roles, :id => false, force: true do |t|
t.bigint :permission_id, default: 0, null: false
t.bigint :role_id, default: 0, null: false
end
add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
create_table "projects", :force => true do |t|
t.column "name", :string, :limit => 30, :default => "", :null => false
t.column "description", :string, :default => "", :null => false
t.column "homepage", :string, :limit => 60, :default => ""
t.column "is_public", :boolean, :default => true, :null => false
t.column "parent_id", :integer
t.column "projects_count", :integer, :default => 0
t.column "created_on", :timestamp
t.column "updated_on", :timestamp
create_table :projects, force: true do |t|
t.string :name, limit: 30, default: "", null: false
t.string :description, default: "", null: false
t.string :homepage, limit: 60, default: ""
t.boolean :is_public, default: true, null: false
t.bigint :parent_id
t.integer :projects_count, default: 0
t.datetime :created_on
t.datetime :updated_on
end
create_table "roles", :force => true do |t|
t.column "name", :string, :limit => 30, :default => "", :null => false
create_table :roles, force: true do |t|
t.string :name, limit: 30, default: "", null: false
end
create_table "tokens", :force => true do |t|
t.column "user_id", :integer, :default => 0, :null => false
t.column "action", :string, :limit => 30, :default => "", :null => false
t.column "value", :string, :limit => 40, :default => "", :null => false
t.column "created_on", :datetime, :null => false
create_table :tokens, force: true do |t|
t.bigint :user_id, default: 0, null: false
t.string :action, limit: 30, default: "", null: false
t.string :value, limit: 40, default: "", null: false
t.datetime :created_on, null: false
end
create_table "trackers", :force => true do |t|
t.column "name", :string, :limit => 30, :default => "", :null => false
t.column "is_in_chlog", :boolean, :default => false, :null => false
create_table :trackers, force: true do |t|
t.string :name, limit: 30, default: "", null: false
t.boolean :is_in_chlog, default: false, null: false
end
create_table "users", :force => true do |t|
t.column "login", :string, :limit => 30, :default => "", :null => false
t.column "hashed_password", :string, :limit => 40, :default => "", :null => false
t.column "firstname", :string, :limit => 30, :default => "", :null => false
t.column "lastname", :string, :limit => 30, :default => "", :null => false
t.column "mail", :string, :limit => 60, :default => "", :null => false
t.column "mail_notification", :boolean, :default => true, :null => false
t.column "admin", :boolean, :default => false, :null => false
t.column "status", :integer, :default => 1, :null => false
t.column "last_login_on", :datetime
t.column "language", :string, :limit => 2, :default => ""
t.column "auth_source_id", :integer
t.column "created_on", :timestamp
t.column "updated_on", :timestamp
create_table :users, force: true do |t|
t.string :login, limit: 30, default: "", null: false
t.string :hashed_password, limit: 40, default: "", null: false
t.string :firstname, limit: 30, default: "", null: false
t.string :lastname, limit: 30, default: "", null: false
t.string :mail, limit: 60, default: "", null: false
t.boolean :mail_notification, default: true, null: false
t.boolean :admin, default: false, null: false
t.integer :status, default: 1, null: false
t.datetime :last_login_on
t.string :language, limit: 2, default: ""
t.bigint :auth_source_id
t.datetime :created_on
t.datetime :updated_on
end
create_table "versions", :force => true do |t|
t.column "project_id", :integer, :default => 0, :null => false
t.column "name", :string, :limit => 30, :default => "", :null => false
t.column "description", :string, :default => ""
t.column "effective_date", :date
t.column "created_on", :timestamp
t.column "updated_on", :timestamp
create_table :versions, force: true do |t|
t.bigint :project_id, default: 0, null: false
t.string :name, limit: 30, default: "", null: false
t.string :description, default: ""
t.date "effective_date"
t.datetime :created_on
t.datetime :updated_on
end
add_index "versions", ["project_id"], :name => "versions_project_id"
create_table "workflows", :force => true do |t|
t.column "tracker_id", :integer, :default => 0, :null => false
t.column "old_status_id", :integer, :default => 0, :null => false
t.column "new_status_id", :integer, :default => 0, :null => false
t.column "role_id", :integer, :default => 0, :null => false
create_table :workflows, force: true do |t|
t.bigint :tracker_id, default: 0, null: false
t.bigint :old_status_id, default: 0, null: false
t.bigint :new_status_id, default: 0, null: false
t.bigint :role_id, default: 0, null: false
end
# project
db/migrate/002_issue_move.rb (working copy)
class IssueMove < ActiveRecord::Migration[4.2]
class IssueMove < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/003_issue_add_note.rb (working copy)
class IssueAddNote < ActiveRecord::Migration[4.2]
class IssueAddNote < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/004_export_pdf.rb (working copy)
class ExportPdf < ActiveRecord::Migration[4.2]
class ExportPdf < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/005_issue_start_date.rb (working copy)
class IssueStartDate < ActiveRecord::Migration[4.2]
class IssueStartDate < ActiveRecord::Migration[5.2]
def self.up
add_column :issues, :start_date, :date
add_column :issues, :done_ratio, :integer, :default => 0, :null => false
add_column :issues, :done_ratio, :integer, default: 0, null: false
end
def self.down
db/migrate/006_calendar_and_activity.rb (working copy)
class CalendarAndActivity < ActiveRecord::Migration[4.2]
class CalendarAndActivity < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/007_create_journals.rb (working copy)
class CreateJournals < ActiveRecord::Migration[4.2]
class CreateJournals < ActiveRecord::Migration[5.2]
# model removed, but needed for data migration
class IssueHistory < ActiveRecord::Base; belongs_to :issue; end
......
class Permission < ActiveRecord::Base; end
def self.up
create_table :journals, :force => true do |t|
t.column "journalized_id", :integer, :default => 0, :null => false
t.column "journalized_type", :string, :limit => 30, :default => "", :null => false
t.column "user_id", :integer, :default => 0, :null => false
t.column "notes", :text
t.column "created_on", :datetime, :null => false
create_table :journals, force: true do |t|
t.bigint :journalized_id, default: 0, null: false
t.string :journalized_type, limit: 30, default: "", null: false
t.bigint :user_id, default: 0, null: false
t.text :notes
t.datetime :created_on, null: false
end
create_table :journal_details, :force => true do |t|
t.column "journal_id", :integer, :default => 0, :null => false
t.column "property", :string, :limit => 30, :default => "", :null => false
t.column "prop_key", :string, :limit => 30, :default => "", :null => false
t.column "old_value", :string
t.column "value", :string
create_table :journal_details, force: true do |t|
t.bigint :journal_id, default: 0, null: false
t.string :property, limit: 30, default: "", null: false
t.string :prop_key, limit: 30, default: "", null: false
t.string :old_value
t.string :value
end
# indexes
......
drop_table :journal_details
drop_table :journals
create_table "issue_histories", :force => true do |t|
t.column "issue_id", :integer, :default => 0, :null => false
t.column "status_id", :integer, :default => 0, :null => false
t.column "author_id", :integer, :default => 0, :null => false
t.column "notes", :text, :default => ""
t.column "created_on", :timestamp
create_table :issue_histories, force: true do |t|
t.bigint :issue_id, default: 0, null: false
t.bigint :status_id, default: 0, null: false
t.bigint :author_id, default: 0, null: false
t.text :notes, default: ""
t.datetime :created_on
end
add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
db/migrate/008_create_user_preferences.rb (working copy)
class CreateUserPreferences < ActiveRecord::Migration[4.2]
class CreateUserPreferences < ActiveRecord::Migration[5.2]
def self.up
create_table :user_preferences do |t|
t.column "user_id", :integer, :default => 0, :null => false
t.column "others", :text
t.bigint :user_id, default: 0, null: false
t.text :others
end
end
db/migrate/009_add_hide_mail_pref.rb (working copy)
class AddHideMailPref < ActiveRecord::Migration[4.2]
class AddHideMailPref < ActiveRecord::Migration[5.2]
def self.up
add_column :user_preferences, :hide_mail, :boolean, :default => false
add_column :user_preferences, :hide_mail, :boolean, default: false
end
def self.down
db/migrate/010_create_comments.rb (working copy)
class CreateComments < ActiveRecord::Migration[4.2]
class CreateComments < ActiveRecord::Migration[5.2]
def self.up
create_table :comments do |t|
t.column :commented_type, :string, :limit => 30, :default => "", :null => false
t.column :commented_id, :integer, :default => 0, :null => false
t.column :author_id, :integer, :default => 0, :null => false
t.column :comments, :text
t.column :created_on, :datetime, :null => false
t.column :updated_on, :datetime, :null => false
t.string :commented_type, limit: 30, default: "", null: false
t.bigint :commented_id, default: 0, null: false
t.bigint :author_id, default: 0, null: false
t.text :comments
t.datetime :created_on, null: false
t.datetime :updated_on, null: false
end
end
db/migrate/011_add_news_comments_count.rb (working copy)
class AddNewsCommentsCount < ActiveRecord::Migration[4.2]
class AddNewsCommentsCount < ActiveRecord::Migration[5.2]
def self.up
add_column :news, :comments_count, :integer, :default => 0, :null => false
add_column :news, :comments_count, :integer, default: 0, null: false
end
def self.down
db/migrate/012_add_comments_permissions.rb (working copy)
class AddCommentsPermissions < ActiveRecord::Migration[4.2]
class AddCommentsPermissions < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/013_create_queries.rb (working copy)
class CreateQueries < ActiveRecord::Migration[4.2]
class CreateQueries < ActiveRecord::Migration[5.2]
def self.up
create_table :queries, :force => true do |t|
t.column "project_id", :integer
t.column "name", :string, :default => "", :null => false
t.column "filters", :text
t.column "user_id", :integer, :default => 0, :null => false
t.column "is_public", :boolean, :default => false, :null => false
create_table :queries, force: true do |t|
t.bigint :project_id
t.string :name, default: "", null: false
t.text :filters
t.bigint :user_id, default: 0, null: false
t.boolean :is_public, default: false, null: false
end
end
db/migrate/014_add_queries_permissions.rb (working copy)
class AddQueriesPermissions < ActiveRecord::Migration[4.2]
class AddQueriesPermissions < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/015_create_repositories.rb (working copy)
class CreateRepositories < ActiveRecord::Migration[4.2]
class CreateRepositories < ActiveRecord::Migration[5.2]
def self.up
create_table :repositories, :force => true do |t|
t.column "project_id", :integer, :default => 0, :null => false
t.column "url", :string, :default => "", :null => false
create_table :repositories, force: true do |t|
t.bigint :project_id, default: 0, null: false
t.string :url, default: "", null: false
end
end
db/migrate/016_add_repositories_permissions.rb (working copy)
class AddRepositoriesPermissions < ActiveRecord::Migration[4.2]
class AddRepositoriesPermissions < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/017_create_settings.rb (working copy)
class CreateSettings < ActiveRecord::Migration[4.2]
class CreateSettings < ActiveRecord::Migration[5.2]
def self.up
create_table :settings, :force => true do |t|
t.column "name", :string, :limit => 30, :default => "", :null => false
t.column "value", :text
create_table :settings, force: true do |t|
t.string :name, limit: 30, default: "", null: false
t.text :value
end
end
db/migrate/018_set_doc_and_files_notifications.rb (working copy)
class SetDocAndFilesNotifications < ActiveRecord::Migration[4.2]
class SetDocAndFilesNotifications < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/019_add_issue_status_position.rb (working copy)
class AddIssueStatusPosition < ActiveRecord::Migration[4.2]
class AddIssueStatusPosition < ActiveRecord::Migration[5.2]
def self.up
add_column :issue_statuses, :position, :integer, :default => 1
add_column :issue_statuses, :position, :integer, default: 1
IssueStatus.all.each_with_index {|status, i| status.update_attribute(:position, i+1)}
end
db/migrate/020_add_role_position.rb (working copy)
class AddRolePosition < ActiveRecord::Migration[4.2]
class AddRolePosition < ActiveRecord::Migration[5.2]
def self.up
add_column :roles, :position, :integer, :default => 1
add_column :roles, :position, :integer, default: 1
Role.all.each_with_index {|role, i| role.update_attribute(:position, i+1)}
end
db/migrate/021_add_tracker_position.rb (working copy)
class AddTrackerPosition < ActiveRecord::Migration[4.2]
class AddTrackerPosition < ActiveRecord::Migration[5.2]
def self.up
add_column :trackers, :position, :integer, :default => 1
add_column :trackers, :position, :integer, default: 1
Tracker.all.each_with_index {|tracker, i| tracker.update_attribute(:position, i+1)}
end
db/migrate/022_serialize_possibles_values.rb (working copy)
class SerializePossiblesValues < ActiveRecord::Migration[4.2]
class SerializePossiblesValues < ActiveRecord::Migration[5.2]
def self.up
CustomField.all.each do |field|
if field.possible_values and field.possible_values.is_a? String
db/migrate/023_add_tracker_is_in_roadmap.rb (working copy)
class AddTrackerIsInRoadmap < ActiveRecord::Migration[4.2]
class AddTrackerIsInRoadmap < ActiveRecord::Migration[5.2]
def self.up
add_column :trackers, :is_in_roadmap, :boolean, :default => true, :null => false
add_column :trackers, :is_in_roadmap, :boolean, default: true, null: false
end
def self.down
db/migrate/024_add_roadmap_permission.rb (working copy)
class AddRoadmapPermission < ActiveRecord::Migration[4.2]
class AddRoadmapPermission < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/025_add_search_permission.rb (working copy)
class AddSearchPermission < ActiveRecord::Migration[4.2]
class AddSearchPermission < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/026_add_repository_login_and_password.rb (working copy)
class AddRepositoryLoginAndPassword < ActiveRecord::Migration[4.2]
class AddRepositoryLoginAndPassword < ActiveRecord::Migration[5.2]
def self.up
add_column :repositories, :login, :string, :limit => 60, :default => ""
add_column :repositories, :password, :string, :limit => 60, :default => ""
add_column :repositories, :login, :string, limit: 60, default: ""
add_column :repositories, :password, :string, limit: 60, default: ""
end
def self.down
db/migrate/027_create_wikis.rb (working copy)
class CreateWikis < ActiveRecord::Migration[4.2]
class CreateWikis < ActiveRecord::Migration[5.2]
def self.up
create_table :wikis do |t|
t.column :project_id, :integer, :null => false
t.column :start_page, :string, :limit => 255, :null => false
t.column :status, :integer, :default => 1, :null => false
t.bigint :project_id, null: false
t.string :start_page, limit: 255, null: false
t.integer :status, default: 1, null: false
end
add_index :wikis, :project_id, :name => :wikis_project_id
end
db/migrate/028_create_wiki_pages.rb (working copy)
class CreateWikiPages < ActiveRecord::Migration[4.2]
class CreateWikiPages < ActiveRecord::Migration[5.2]
def self.up
create_table :wiki_pages do |t|
t.column :wiki_id, :integer, :null => false
t.column :title, :string, :limit => 255, :null => false
t.column :created_on, :datetime, :null => false
t.bigint :wiki_id, null: false
t.string :title, limit: 255, null: false
t.datetime :created_on, null: false
end
add_index :wiki_pages, [:wiki_id, :title], :name => :wiki_pages_wiki_id_title
end
db/migrate/029_create_wiki_contents.rb (working copy)
class CreateWikiContents < ActiveRecord::Migration[4.2]
class CreateWikiContents < ActiveRecord::Migration[5.2]
def self.up
create_table :wiki_contents do |t|
t.column :page_id, :integer, :null => false
t.column :author_id, :integer
t.column :text, :text
t.column :comments, :string, :limit => 255, :default => ""
t.column :updated_on, :datetime, :null => false
t.column :version, :integer, :null => false
t.bigint :page_id, null: false
t.bigint :author_id
t.text :text
t.string :comments, limit: 255, default: ""
t.datetime :updated_on, null: false
t.integer :version, null: false
end
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 :page_id, :integer, :null => false
t.column :author_id, :integer
t.column :data, :binary
t.column :compression, :string, :limit => 6, :default => ""
t.column :comments, :string, :limit => 255, :default => ""
t.column :updated_on, :datetime, :null => false
t.column :version, :integer, :null => false
t.bigint :wiki_content_id, null: false
t.bigint :page_id, null: false
t.bigint :author_id
t.binary :data
t.string :compression, limit: 6, default: ""
t.string :comments, limit: 255, default: ""
t.datetime :updated_on, null: false
t.integer :version, null: false
end
add_index :wiki_content_versions, :wiki_content_id, :name => :wiki_content_versions_wcid
end
db/migrate/030_add_projects_feeds_permissions.rb (working copy)
class AddProjectsFeedsPermissions < ActiveRecord::Migration[4.2]
class AddProjectsFeedsPermissions < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/031_add_repository_root_url.rb (working copy)
class AddRepositoryRootUrl < ActiveRecord::Migration[4.2]
class AddRepositoryRootUrl < ActiveRecord::Migration[5.2]
def self.up
add_column :repositories, :root_url, :string, :limit => 255, :default => ""
add_column :repositories, :root_url, :string, limit: 255, default: ""
end
def self.down
db/migrate/032_create_time_entries.rb (working copy)
class CreateTimeEntries < ActiveRecord::Migration[4.2]
class CreateTimeEntries < ActiveRecord::Migration[5.2]
def self.up
create_table :time_entries do |t|
t.column :project_id, :integer, :null => false
t.column :user_id, :integer, :null => false
t.column :issue_id, :integer
t.column :hours, :float, :null => false
t.column :comments, :string, :limit => 255
t.column :activity_id, :integer, :null => false
t.column :spent_on, :date, :null => false
t.column :tyear, :integer, :null => false
t.column :tmonth, :integer, :null => false
t.column :tweek, :integer, :null => false
t.column :created_on, :datetime, :null => false
t.column :updated_on, :datetime, :null => false
t.bigint :project_id, null: false
t.bigint :user_id, null: false
t.bigint :issue_id
t.float :hours, null: false
t.string :comments, limit: 255
t.bigint :activity_id, null: false
t.date :spent_on, null: false
t.integer :tyear, null: false
t.integer :tmonth, null: false
t.integer :tweek, null: false
t.datetime :created_on, null: false
t.datetime :updated_on, 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
db/migrate/033_add_timelog_permissions.rb (working copy)
class AddTimelogPermissions < ActiveRecord::Migration[4.2]
class AddTimelogPermissions < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/034_create_changesets.rb (working copy)
class CreateChangesets < ActiveRecord::Migration[4.2]
class CreateChangesets < ActiveRecord::Migration[5.2]
def self.up
create_table :changesets do |t|
t.column :repository_id, :integer, :null => false
t.column :revision, :integer, :null => false
t.column :committer, :string, :limit => 30
t.column :committed_on, :datetime, :null => false
t.column :comments, :text
t.bigint :repository_id, null: false
t.integer :revision, null: false
t.string :committer, limit: 30
t.datetime :committed_on, null: false
t.text :comments
end
add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev
end
db/migrate/035_create_changes.rb (working copy)
class CreateChanges < ActiveRecord::Migration[4.2]
class CreateChanges < ActiveRecord::Migration[5.2]
def self.up
create_table :changes do |t|
t.column :changeset_id, :integer, :null => false
t.column :action, :string, :limit => 1, :default => "", :null => false
t.column :path, :string, :default => "", :null => false
t.column :from_path, :string
t.column :from_revision, :integer
t.bigint :changeset_id, null: false
t.string :action, limit: 1, default: "", null: false
t.string :path, default: "", null: false
t.string :from_path
t.integer :from_revision
end
add_index :changes, [:changeset_id], :name => :changesets_changeset_id
end
db/migrate/036_add_changeset_commit_date.rb (working copy)
class AddChangesetCommitDate < ActiveRecord::Migration[4.2]
class AddChangesetCommitDate < ActiveRecord::Migration[5.2]
def self.up
add_column :changesets, :commit_date, :date
Changeset.update_all "commit_date = committed_on"
db/migrate/037_add_project_identifier.rb (working copy)
class AddProjectIdentifier < ActiveRecord::Migration[4.2]
class AddProjectIdentifier < ActiveRecord::Migration[5.2]
def self.up
add_column :projects, :identifier, :string, :limit => 20
add_column :projects, :identifier, :string, limit: 20
end
def self.down
db/migrate/038_add_custom_field_is_filter.rb (working copy)
class AddCustomFieldIsFilter < ActiveRecord::Migration[4.2]
class AddCustomFieldIsFilter < ActiveRecord::Migration[5.2]
def self.up
add_column :custom_fields, :is_filter, :boolean, :null => false, :default => false
add_column :custom_fields, :is_filter, :boolean, null: false, default: false
end
def self.down
db/migrate/039_create_watchers.rb (working copy)
class CreateWatchers < ActiveRecord::Migration[4.2]
class CreateWatchers < ActiveRecord::Migration[5.2]
def self.up
create_table :watchers do |t|
t.column :watchable_type, :string, :default => "", :null => false
t.column :watchable_id, :integer, :default => 0, :null => false
t.column :user_id, :integer
t.string :watchable_type, default: "", null: false
t.bigint :watchable_id, default: 0, null: false
t.bigint :user_id
end
end
db/migrate/040_create_changesets_issues.rb (working copy)
class CreateChangesetsIssues < ActiveRecord::Migration[4.2]
class CreateChangesetsIssues < ActiveRecord::Migration[5.2]
def self.up
create_table :changesets_issues, :id => false do |t|
t.column :changeset_id, :integer, :null => false
t.column :issue_id, :integer, :null => false
t.bigint :changeset_id, null: false
t.bigint :issue_id, null: false
end
add_index :changesets_issues, [:changeset_id, :issue_id], :unique => true, :name => :changesets_issues_ids
end
db/migrate/041_rename_comment_to_comments.rb (working copy)
class RenameCommentToComments < ActiveRecord::Migration[4.2]
class RenameCommentToComments < ActiveRecord::Migration[5.2]
def self.up
rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns(Comment.table_name).detect{|c| c.name == "comment"}
rename_column(:wiki_contents, :comment, :comments) if ActiveRecord::Base.connection.columns(WikiContent.table_name).detect{|c| c.name == "comment"}
db/migrate/042_create_issue_relations.rb (working copy)
class CreateIssueRelations < ActiveRecord::Migration[4.2]
class CreateIssueRelations < ActiveRecord::Migration[5.2]
def self.up
create_table :issue_relations do |t|
t.column :issue_from_id, :integer, :null => false
t.column :issue_to_id, :integer, :null => false
t.column :relation_type, :string, :default => "", :null => false
t.column :delay, :integer
t.bigint :issue_from_id, null: false
t.bigint :issue_to_id, null: false
t.string :relation_type, default: "", null: false
t.integer :delay
end
end
db/migrate/043_add_relations_permissions.rb (working copy)
class AddRelationsPermissions < ActiveRecord::Migration[4.2]
class AddRelationsPermissions < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/044_set_language_length_to_five.rb (working copy)
class SetLanguageLengthToFive < ActiveRecord::Migration[4.2]
class SetLanguageLengthToFive < ActiveRecord::Migration[5.2]
def self.up
change_column :users, :language, :string, :limit => 5, :default => ""
change_column :users, :language, :string, limit: 5, default: ""
end
def self.down
db/migrate/045_create_boards.rb (working copy)
class CreateBoards < ActiveRecord::Migration[4.2]
class CreateBoards < ActiveRecord::Migration[5.2]
def self.up
create_table :boards do |t|
t.column :project_id, :integer, :null => false
t.column :name, :string, :default => "", :null => false
t.column :description, :string
t.column :position, :integer, :default => 1
t.column :topics_count, :integer, :default => 0, :null => false
t.column :messages_count, :integer, :default => 0, :null => false
t.column :last_message_id, :integer
t.bigint :project_id, null: false
t.string :name, default: "", null: false
t.string :description
t.integer :position, default: 1
t.integer :topics_count, default: 0, null: false
t.integer :messages_count, default: 0, null: false
t.bigint :last_message_id
end
add_index :boards, [:project_id], :name => :boards_project_id
end
db/migrate/046_create_messages.rb (working copy)
class CreateMessages < ActiveRecord::Migration[4.2]
class CreateMessages < ActiveRecord::Migration[5.2]
def self.up
create_table :messages do |t|
t.column :board_id, :integer, :null => false
t.column :parent_id, :integer
t.column :subject, :string, :default => "", :null => false
t.column :content, :text
t.column :author_id, :integer
t.column :replies_count, :integer, :default => 0, :null => false
t.column :last_reply_id, :integer
t.column :created_on, :datetime, :null => false
t.column :updated_on, :datetime, :null => false
t.bigint :board_id, null: false
t.bigint :parent_id
t.string :subject, default: "", null: false
t.text :content
t.bigint :author_id
t.integer :replies_count, default: 0, null: false
t.bigint :last_reply_id
t.datetime :created_on, null: false
t.datetime :updated_on, null: false
end
add_index :messages, [:board_id], :name => :messages_board_id
add_index :messages, [:parent_id], :name => :messages_parent_id
db/migrate/047_add_boards_permissions.rb (working copy)
class AddBoardsPermissions < ActiveRecord::Migration[4.2]
class AddBoardsPermissions < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/048_allow_null_version_effective_date.rb (working copy)
class AllowNullVersionEffectiveDate < ActiveRecord::Migration[4.2]
class AllowNullVersionEffectiveDate < ActiveRecord::Migration[5.2]
def self.up
change_column :versions, :effective_date, :date, :default => nil, :null => true
change_column :versions, :effective_date, :date, default: nil, null: true
end
def self.down
db/migrate/049_add_wiki_destroy_page_permission.rb (working copy)
class AddWikiDestroyPagePermission < ActiveRecord::Migration[4.2]
class AddWikiDestroyPagePermission < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/050_add_wiki_attachments_permissions.rb (working copy)
class AddWikiAttachmentsPermissions < ActiveRecord::Migration[4.2]
class AddWikiAttachmentsPermissions < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/051_add_project_status.rb (working copy)
class AddProjectStatus < ActiveRecord::Migration[4.2]
class AddProjectStatus < ActiveRecord::Migration[5.2]
def self.up
add_column :projects, :status, :integer, :default => 1, :null => false
add_column :projects, :status, :integer, default: 1, null: false
end
def self.down
db/migrate/052_add_changes_revision.rb (working copy)
class AddChangesRevision < ActiveRecord::Migration[4.2]
class AddChangesRevision < ActiveRecord::Migration[5.2]
def self.up
add_column :changes, :revision, :string
end
db/migrate/053_add_changes_branch.rb (working copy)
class AddChangesBranch < ActiveRecord::Migration[4.2]
class AddChangesBranch < ActiveRecord::Migration[5.2]
def self.up
add_column :changes, :branch, :string
end
db/migrate/054_add_changesets_scmid.rb (working copy)
class AddChangesetsScmid < ActiveRecord::Migration[4.2]
class AddChangesetsScmid < ActiveRecord::Migration[5.2]
def self.up
add_column :changesets, :scmid, :string
end
db/migrate/055_add_repositories_type.rb (working copy)
class AddRepositoriesType < ActiveRecord::Migration[4.2]
class AddRepositoriesType < ActiveRecord::Migration[5.2]
def self.up
add_column :repositories, :type, :string
# Set class name for existing SVN repositories
db/migrate/056_add_repositories_changes_permission.rb (working copy)
class AddRepositoriesChangesPermission < ActiveRecord::Migration[4.2]
class AddRepositoriesChangesPermission < ActiveRecord::Migration[5.2]
# model removed
class Permission < ActiveRecord::Base; end
db/migrate/057_add_versions_wiki_page_title.rb (working copy)
class AddVersionsWikiPageTitle < ActiveRecord::Migration[4.2]
class AddVersionsWikiPageTitle < ActiveRecord::Migration[5.2]
def self.up
add_column :versions, :wiki_page_title, :string
end
db/migrate/058_add_issue_categories_assigned_to_id.rb (working copy)
class AddIssueCategoriesAssignedToId < ActiveRecord::Migration[4.2]
class AddIssueCategoriesAssignedToId < ActiveRecord::Migration[5.2]
def self.up
add_column :issue_categories, :assigned_to_id, :integer
add_column :issue_categories, :assigned_to_id, :bigint
end
def self.down
db/migrate/059_add_roles_assignable.rb (working copy)
class AddRolesAssignable < ActiveRecord::Migration[4.2]
class AddRolesAssignable < ActiveRecord::Migration[5.2]
def self.up
add_column :roles, :assignable, :boolean, :default => true
add_column :roles, :assignable, :boolean, default: true
end
def self.down
db/migrate/060_change_changesets_committer_limit.rb (working copy)
class ChangeChangesetsCommitterLimit < ActiveRecord::Migration[4.2]
class ChangeChangesetsCommitterLimit < ActiveRecord::Migration[5.2]
def self.up
change_column :changesets, :committer, :string, :limit => nil
change_column :changesets, :committer, :string, limit: nil
end
def self.down
change_column :changesets, :committer, :string, :limit => 30
change_column :changesets, :committer, :string, limit: 30
end
end
db/migrate/061_add_roles_builtin.rb (working copy)
class AddRolesBuiltin < ActiveRecord::Migration[4.2]
class AddRolesBuiltin < ActiveRecord::Migration[5.2]
def self.up
add_column :roles, :builtin, :integer, :default => 0, :null => false
add_column :roles, :builtin, :integer, default: 0, null: false
end
def self.down
db/migrate/062_insert_builtin_roles.rb (working copy)
class InsertBuiltinRoles < ActiveRecord::Migration[4.2]
class InsertBuiltinRoles < ActiveRecord::Migration[5.2]
def self.up
Role.reset_column_information
nonmember = Role.new(:name => 'Non member', :position => 0)
db/migrate/063_add_roles_permissions.rb (working copy)
class AddRolesPermissions < ActiveRecord::Migration[4.2]
class AddRolesPermissions < ActiveRecord::Migration[5.2]
def self.up
add_column :roles, :permissions, :text
end
db/migrate/064_drop_permissions.rb (working copy)
class DropPermissions < ActiveRecord::Migration[4.2]
class DropPermissions < ActiveRecord::Migration[5.2]
def self.up
drop_table :permissions
drop_table :permissions_roles
db/migrate/065_add_settings_updated_on.rb (working copy)
class AddSettingsUpdatedOn < ActiveRecord::Migration[4.2]
class AddSettingsUpdatedOn < ActiveRecord::Migration[5.2]
def self.up
add_column :settings, :updated_on, :timestamp
# set updated_on
db/migrate/066_add_custom_value_customized_index.rb (working copy)
class AddCustomValueCustomizedIndex < ActiveRecord::Migration[4.2]
class AddCustomValueCustomizedIndex < ActiveRecord::Migration[5.2]
def self.up
add_index :custom_values, [:customized_type, :customized_id], :name => :custom_values_customized
end
db/migrate/067_create_wiki_redirects.rb (working copy)
class CreateWikiRedirects < ActiveRecord::Migration[4.2]
class CreateWikiRedirects < ActiveRecord::Migration[5.2]
def self.up
create_table :wiki_redirects do |t|
t.column :wiki_id, :integer, :null => false
t.column :title, :string
t.column :redirects_to, :string
t.column :created_on, :datetime, :null => false
t.bigint :wiki_id, null: false
t.string :title
t.string :redirects_to
t.datetime :created_on, null: false
end
add_index :wiki_redirects, [:wiki_id, :title], :name => :wiki_redirects_wiki_id_title
end
db/migrate/068_create_enabled_modules.rb (working copy)
class CreateEnabledModules < ActiveRecord::Migration[4.2]
class CreateEnabledModules < ActiveRecord::Migration[5.2]
def self.up
create_table :enabled_modules do |t|
t.column :project_id, :integer
t.column :name, :string, :null => false
t.bigint :project_id
t.string :name, null: false
end
add_index :enabled_modules, [:project_id], :name => :enabled_modules_project_id
db/migrate/069_add_issues_estimated_hours.rb (working copy)
class AddIssuesEstimatedHours < ActiveRecord::Migration[4.2]
class AddIssuesEstimatedHours < ActiveRecord::Migration[5.2]
def self.up
add_column :issues, :estimated_hours, :float
end
db/migrate/070_change_attachments_content_type_limit.rb (working copy)
class ChangeAttachmentsContentTypeLimit < ActiveRecord::Migration[4.2]
class ChangeAttachmentsContentTypeLimit < ActiveRecord::Migration[5.2]
def self.up
change_column :attachments, :content_type, :string, :limit => nil
change_column :attachments, :content_type, :string, limit: nil
end
def self.down
change_column :attachments, :content_type, :string, :limit => 60
change_column :attachments, :content_type, :string, limit: 60
end
end
db/migrate/071_add_queries_column_names.rb (working copy)
class AddQueriesColumnNames < ActiveRecord::Migration[4.2]
class AddQueriesColumnNames < ActiveRecord::Migration[5.2]
def self.up
add_column :queries, :column_names, :text
end
db/migrate/072_add_enumerations_position.rb (working copy)
class AddEnumerationsPosition < ActiveRecord::Migration[4.2]
class AddEnumerationsPosition < ActiveRecord::Migration[5.2]
def self.up
add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position')
add_column(:enumerations, :position, :integer, default: 1) unless Enumeration.column_names.include?('position')
Enumeration.all.group_by(&:opt).each do |opt, enums|
enums.each_with_index do |enum, i|
# do not call model callbacks
db/migrate/073_add_enumerations_is_default.rb (working copy)
class AddEnumerationsIsDefault < ActiveRecord::Migration[4.2]
class AddEnumerationsIsDefault < ActiveRecord::Migration[5.2]
def self.up
add_column :enumerations, :is_default, :boolean, :default => false, :null => false
add_column :enumerations, :is_default, :boolean, default: false, null: false
end
def self.down
db/migrate/074_add_auth_sources_tls.rb (working copy)
class AddAuthSourcesTls < ActiveRecord::Migration[4.2]
class AddAuthSourcesTls < ActiveRecord::Migration[5.2]
def self.up
add_column :auth_sources, :tls, :boolean, :default => false, :null => false
add_column :auth_sources, :tls, :boolean, default: false, null: false
end
def self.down
db/migrate/075_add_members_mail_notification.rb (working copy)
class AddMembersMailNotification < ActiveRecord::Migration[4.2]
class AddMembersMailNotification < ActiveRecord::Migration[5.2]
def self.up
add_column :members, :mail_notification, :boolean, :default => false, :null => false
add_column :members, :mail_notification, :boolean, default: false, null: false
end
def self.down
db/migrate/076_allow_null_position.rb (working copy)
class AllowNullPosition < ActiveRecord::Migration[4.2]
class AllowNullPosition < ActiveRecord::Migration[5.2]
def self.up
Enumeration.reset_column_information
# removes the 'not null' constraint on position fields
change_column :issue_statuses, :position, :integer, :default => 1, :null => true
change_column :roles, :position, :integer, :default => 1, :null => true
change_column :trackers, :position, :integer, :default => 1, :null => true
change_column :boards, :position, :integer, :default => 1, :null => true
change_column :enumerations, :position, :integer, :default => 1, :null => true
change_column :issue_statuses, :position, :integer, default: 1, null: true
change_column :roles, :position, :integer, default: 1, null: true
change_column :trackers, :position, :integer, default: 1, null: true
change_column :boards, :position, :integer, default: 1, null: true
change_column :enumerations, :position, :integer, default: 1, null: true
end
def self.down
... This diff was truncated because it exceeds the maximum size that can be displayed.
(1-1/2)