Add version 4.2 to all existing migrations
DB schema generated by a migration may look different in rails 4 and 5 (because rails 5 may use different default values). For this reason it's important to explicitly set for which rails version a migration was written for. See https://stackoverflow.com/questions/35929869/activerecordmigration-deprecation-warning-asks-for-rails-version-but-im-no/35930912#35930912
This commit is contained in:
parent
fcec474ceb
commit
0fc9f9d3e7
1062 changed files with 1064 additions and 1064 deletions
|
@ -1,4 +1,4 @@
|
|||
class InitSchema < ActiveRecord::Migration
|
||||
class InitSchema < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = true
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class FixNamespaces < ActiveRecord::Migration
|
||||
class FixNamespaces < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def up
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class ChangeStateToAllowEmptyMergeRequestDiffs < ActiveRecord::Migration
|
||||
class ChangeStateToAllowEmptyMergeRequestDiffs < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
change_column :merge_request_diffs, :state, :string, null: true,
|
||||
default: nil
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddIndexOnIid < ActiveRecord::Migration
|
||||
class AddIndexOnIid < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
RemoveDuplicateIid.clean(Issue)
|
||||
RemoveDuplicateIid.clean(MergeRequest, 'target_project_id')
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class IndexOnCurrentSignInAt < ActiveRecord::Migration
|
||||
class IndexOnCurrentSignInAt < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index :users, :current_sign_in_at
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddNotesIndexUpdatedAt < ActiveRecord::Migration
|
||||
class AddNotesIndexUpdatedAt < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index :notes, :updated_at
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddRepoSizeToDb < ActiveRecord::Migration
|
||||
class AddRepoSizeToDb < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :projects, :repository_size, :float, default: 0
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class MigrateRepoSize < ActiveRecord::Migration
|
||||
class MigrateRepoSize < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def up
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddPositionToMergeRequest < ActiveRecord::Migration
|
||||
class AddPositionToMergeRequest < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :merge_requests, :position, :integer, default: 0
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class CreateUsersStarProjects < ActiveRecord::Migration
|
||||
class CreateUsersStarProjects < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class CreateLabels < ActiveRecord::Migration
|
||||
class CreateLabels < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class CreateLabelLinks < ActiveRecord::Migration
|
||||
class CreateLabelLinks < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class MigrateProjectTags < ActiveRecord::Migration
|
||||
class MigrateProjectTags < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
ActsAsTaggableOn::Tagging.where(taggable_type: 'Project', context: 'labels').update_all(context: 'tags')
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class MigrateTaggableLabels < ActiveRecord::Migration
|
||||
class MigrateTaggableLabels < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
taggings = ActsAsTaggableOn::Tagging.where(taggable_type: ['Issue', 'MergeRequest'], context: 'labels')
|
||||
taggings.find_each(batch_size: 500) do |tagging|
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddIndexToLabels < ActiveRecord::Migration
|
||||
class AddIndexToLabels < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index "labels", :project_id
|
||||
add_index "label_links", :label_id
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class MigrateToNewShell < ActiveRecord::Migration
|
||||
class MigrateToNewShell < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
return if Rails.env.test?
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class SerializeServiceProperties < ActiveRecord::Migration
|
||||
class SerializeServiceProperties < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
unless column_exists?(:services, :properties)
|
||||
add_column :services, :properties, :text
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddMembersTable < ActiveRecord::Migration
|
||||
class AddMembersTable < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class MigrateToNewMembersModel < ActiveRecord::Migration
|
||||
class MigrateToNewMembersModel < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute "INSERT INTO members ( user_id, source_id, source_type, access_level, notification_level, type ) SELECT user_id, group_id, 'Namespace', group_access, notification_level, 'GroupMember' FROM users_groups"
|
||||
execute "INSERT INTO members ( user_id, source_id, source_type, access_level, notification_level, type ) SELECT user_id, project_id, 'Project', project_access, notification_level, 'ProjectMember' FROM users_projects"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class RemoveOldMemberTables < ActiveRecord::Migration
|
||||
class RemoveOldMemberTables < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def up
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class MoveSlackServiceToWebhook < ActiveRecord::Migration
|
||||
class MoveSlackServiceToWebhook < ActiveRecord::Migration[4.2]
|
||||
|
||||
DOWNTIME = true
|
||||
DOWNTIME_REASON = 'Move old fields "token" and "subdomain" to one single field "webhook"'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddVisibilityLevelToSnippet < ActiveRecord::Migration
|
||||
class AddVisibilityLevelToSnippet < ActiveRecord::Migration[4.2]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
def up
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddAuditEvent < ActiveRecord::Migration
|
||||
class AddAuditEvent < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# became a problem after commit c8e78d972a5a628870eefca0f2ccea0199c55bda which
|
||||
# was added in GitLab 7.5. With this migration we ensure that all rows in
|
||||
# 'members' have at least some created_at and updated_at timestamp.
|
||||
class AddTimestampsToMembers < ActiveRecord::Migration
|
||||
class AddTimestampsToMembers < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute "UPDATE members SET created_at = NOW() WHERE created_at is NULL"
|
||||
execute "UPDATE members SET updated_at = NOW() WHERE updated_at is NULL"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddIdentityTable < ActiveRecord::Migration
|
||||
class AddIdentityTable < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
create_table :identities do |t|
|
||||
t.string :extern_uid
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddMergeRequestRebaseEnabledToProjects < ActiveRecord::Migration
|
||||
class AddMergeRequestRebaseEnabledToProjects < ActiveRecord::Migration[4.2]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
# Set this constant to true if this migration requires downtime.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddLockedAtToMergeRequest < ActiveRecord::Migration
|
||||
class AddLockedAtToMergeRequest < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :merge_requests, :locked_at, :datetime
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class CreateDoorkeeperTables < ActiveRecord::Migration
|
||||
class CreateDoorkeeperTables < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddOwnerToApplication < ActiveRecord::Migration
|
||||
class AddOwnerToApplication < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :oauth_applications, :owner_id, :integer, null: true
|
||||
add_column :oauth_applications, :owner_type, :string, null: true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddImportDataToProjectTable < ActiveRecord::Migration
|
||||
class AddImportDataToProjectTable < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :projects, :import_type, :string
|
||||
add_column :projects, :import_source, :string
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddDevelopersCanPushToProtectedBranches < ActiveRecord::Migration
|
||||
class AddDevelopersCanPushToProtectedBranches < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :protected_branches, :developers_can_push, :boolean, default: false, null: false
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class CreateApplicationSettings < ActiveRecord::Migration
|
||||
class CreateApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddHomePageUrlForApplicationSettings < ActiveRecord::Migration
|
||||
class AddHomePageUrlForApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :home_page_url, :string
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddGitlabAccessTokenToUser < ActiveRecord::Migration
|
||||
class AddGitlabAccessTokenToUser < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :gitlab_access_token, :string
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddDefaultBranchProtectionSetting < ActiveRecord::Migration
|
||||
class AddDefaultBranchProtectionSetting < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :default_branch_protection, :integer, :default => 2
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddTimestampsToIdentities < ActiveRecord::Migration
|
||||
class AddTimestampsToIdentities < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_timestamps(:identities)
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddIndexToCreatedAt < ActiveRecord::Migration
|
||||
class AddIndexToCreatedAt < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index "users", [:created_at, :id]
|
||||
add_index "members", [:created_at, :id]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddNotificationEmailToUser < ActiveRecord::Migration
|
||||
class AddNotificationEmailToUser < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :users, :notification_email, :string
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddMissingIndex < ActiveRecord::Migration
|
||||
class AddMissingIndex < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index "services", [:created_at, :id]
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddTemplateToService < ActiveRecord::Migration
|
||||
class AddTemplateToService < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :services, :template, :boolean, default: false
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AllowNullInServicesProjectId < ActiveRecord::Migration
|
||||
class AllowNullInServicesProjectId < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_column :services, :project_id, :integer, null: true
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddTwitterSharingEnabledToApplicationSettings < ActiveRecord::Migration
|
||||
class AddTwitterSharingEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :twitter_sharing_enabled, :boolean, default: true
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddHideNoPasswordToUser < ActiveRecord::Migration
|
||||
class AddHideNoPasswordToUser < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :hide_no_password, :boolean, default: false
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddPasswordAutomaticallySetToUser < ActiveRecord::Migration
|
||||
class AddPasswordAutomaticallySetToUser < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :password_automatically_set, :boolean, default: false
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddBitbucketAccessTokenAndSecretToUser < ActiveRecord::Migration
|
||||
class AddBitbucketAccessTokenAndSecretToUser < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :bitbucket_access_token, :string
|
||||
add_column :users, :bitbucket_access_token_secret, :string
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddEventsToServices < ActiveRecord::Migration
|
||||
class AddEventsToServices < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :services, :push_events, :boolean, :default => true
|
||||
add_column :services, :issues_events, :boolean, :default => true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class SetMissingLastActivityAt < ActiveRecord::Migration
|
||||
class SetMissingLastActivityAt < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute "UPDATE projects SET last_activity_at = updated_at WHERE last_activity_at IS NULL"
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddNoteEventsToServices < ActiveRecord::Migration
|
||||
class AddNoteEventsToServices < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :services, :note_events, :boolean, default: true, null: false
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddRestrictedVisibilityLevelsToApplicationSettings < ActiveRecord::Migration
|
||||
class AddRestrictedVisibilityLevelsToApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :restricted_visibility_levels, :text
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class FixNamespaceDuplication < ActiveRecord::Migration
|
||||
class FixNamespaceDuplication < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
#fixes path duplication
|
||||
select_all('SELECT MAX(id) max, COUNT(id) cnt, path FROM namespaces GROUP BY path HAVING COUNT(id) > 1').each do |nms|
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddUniqueIndexToNamespace < ActiveRecord::Migration
|
||||
class AddUniqueIndexToNamespace < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_index :namespaces, column: :name if index_exists?(:namespaces, :name)
|
||||
remove_index :namespaces, column: :path if index_exists?(:namespaces, :path)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddVersionCheckToApplicationSettings < ActiveRecord::Migration
|
||||
class AddVersionCheckToApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :version_check_enabled, :boolean, default: true
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class CreateSubscriptionsTable < ActiveRecord::Migration
|
||||
class CreateSubscriptionsTable < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddLocationToUser < ActiveRecord::Migration
|
||||
class AddLocationToUser < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :location, :string
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class SetIncorrectAssigneeIdToNull < ActiveRecord::Migration
|
||||
class SetIncorrectAssigneeIdToNull < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute "UPDATE issues SET assignee_id = NULL WHERE assignee_id = -1"
|
||||
execute "UPDATE merge_requests SET assignee_id = NULL WHERE assignee_id = -1"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddPublicToKey < ActiveRecord::Migration
|
||||
class AddPublicToKey < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :keys, :public, :boolean, default: false, null: false
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddImportDataToProject < ActiveRecord::Migration
|
||||
class AddImportDataToProject < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :projects, :import_data, :text
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddDeviseTwoFactorToUsers < ActiveRecord::Migration
|
||||
class AddDeviseTwoFactorToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :encrypted_otp_secret, :string
|
||||
add_column :users, :encrypted_otp_secret_iv, :string
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddMaxAttachmentSizeToApplicationSettings < ActiveRecord::Migration
|
||||
class AddMaxAttachmentSizeToApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :max_attachment_size, :integer, default: 10, null: false
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddDeviseTwoFactorBackupableToUsers < ActiveRecord::Migration
|
||||
class AddDeviseTwoFactorBackupableToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :otp_backup_codes, :text
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddInviteDataToMember < ActiveRecord::Migration
|
||||
class AddInviteDataToMember < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :members, :created_by_id, :integer
|
||||
add_column :members, :invite_email, :string
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class FixIdentities < ActiveRecord::Migration
|
||||
class FixIdentities < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
# Up until now, legacy 'ldap' references in the database were charitably
|
||||
# interpreted to point to the first LDAP server specified in the GitLab
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class RenameBuildboxService < ActiveRecord::Migration
|
||||
class RenameBuildboxService < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute "UPDATE services SET type = 'BuildkiteService' WHERE type = 'BuildboxService';"
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddPublicEmailToUsers < ActiveRecord::Migration
|
||||
class AddPublicEmailToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :public_email, :string, default: "", null: false
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class CreateProjectImportData < ActiveRecord::Migration
|
||||
class CreateProjectImportData < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :project_import_data do |t|
|
||||
t.references :project
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class RemoveImportDataFromProject < ActiveRecord::Migration
|
||||
class RemoveImportDataFromProject < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_column :projects, :import_data
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class RemovePeriodsAtEndsOfUsernames < ActiveRecord::Migration
|
||||
class RemovePeriodsAtEndsOfUsernames < ActiveRecord::Migration[4.2]
|
||||
include Gitlab::ShellAdapter
|
||||
|
||||
class Namespace < ActiveRecord::Base
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddDefaultProjectVisibililtyToApplicationSettings < ActiveRecord::Migration
|
||||
class AddDefaultProjectVisibililtyToApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :application_settings, :default_project_visibility, :integer
|
||||
visibility = Settings.gitlab.default_projects_features['visibility_level']
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# This migration is a duplicate of 20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
|
||||
# It shold be applied before the index additions to ensure that `name` is case sensitive.
|
||||
|
||||
class GitlabChangeCollationForTagNames < ActiveRecord::Migration
|
||||
class GitlabChangeCollationForTagNames < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
if ActsAsTaggableOn::Utils.using_mysql?
|
||||
execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class RemoveDuplicateTags < ActiveRecord::Migration
|
||||
class RemoveDuplicateTags < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
select_all("SELECT name, COUNT(id) as cnt FROM tags GROUP BY name HAVING COUNT(id) > 1").each do |tag|
|
||||
tag_name = quote_string(tag["name"])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# rubocop:disable all
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 2)
|
||||
class AddMissingUniqueIndices < ActiveRecord::Migration
|
||||
class AddMissingUniqueIndices < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
add_index :tags, :name, unique: true
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# rubocop:disable all
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 3)
|
||||
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
|
||||
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
add_column :tags, :taggings_count, :integer, default: 0
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# This migration comes from acts_as_taggable_on_engine (originally 4)
|
||||
class AddMissingTaggableIndex < ActiveRecord::Migration
|
||||
class AddMissingTaggableIndex < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
add_index :taggings, [:taggable_id, :taggable_type, :context]
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# This migration comes from acts_as_taggable_on_engine (originally 5)
|
||||
# This migration is added to circumvent issue #623 and have special characters
|
||||
# work properly
|
||||
class ChangeCollationForTagNames < ActiveRecord::Migration
|
||||
class ChangeCollationForTagNames < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
if ActsAsTaggableOn::Utils.using_mysql?
|
||||
execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddDefaultSnippetVisibilityToAppSettings < ActiveRecord::Migration
|
||||
class AddDefaultSnippetVisibilityToAppSettings < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :application_settings, :default_snippet_visibility, :integer
|
||||
visibility = Settings.gitlab.default_projects_features['visibility_level']
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration
|
||||
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
|
||||
SELECT id FROM namespaces WHERE type='Group')")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddRestrictedSignupDomainsToApplicationSettings < ActiveRecord::Migration
|
||||
class AddRestrictedSignupDomainsToApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :restricted_signup_domains, :text
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# becomes
|
||||
#
|
||||
# mentioned in 54f7727c850972f0401c1312a7c4a6a380de5666
|
||||
class ConvertLegacyReferenceNotes < ActiveRecord::Migration
|
||||
class ConvertLegacyReferenceNotes < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute %q{UPDATE notes SET note = trim(both '_' from note) WHERE system = true AND note LIKE '\_%\_'}
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddNoteEventsToWebHooks < ActiveRecord::Migration
|
||||
class AddNoteEventsToWebHooks < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :web_hooks, :note_events, :boolean, default: false, null: false
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserOauthApplicationsToApplicationSettings < ActiveRecord::Migration
|
||||
class AddUserOauthApplicationsToApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :user_oauth_applications, :bool, default: true
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddAfterSignOutPathForApplicationSettings < ActiveRecord::Migration
|
||||
class AddAfterSignOutPathForApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :after_sign_out_path, :string
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddSessionExpireDelayForApplicationSettings < ActiveRecord::Migration
|
||||
class AddSessionExpireDelayForApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
unless column_exists?(:application_settings, :session_expire_delay)
|
||||
add_column :application_settings, :session_expire_delay, :integer, default: 10080, null: false
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddDashboardToUsers < ActiveRecord::Migration
|
||||
class AddDashboardToUsers < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :users, :dashboard, :integer, default: 0
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddDefaultOtpRequiredForLoginValue < ActiveRecord::Migration
|
||||
class AddDefaultOtpRequiredForLoginValue < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute %q{UPDATE users SET otp_required_for_login = FALSE WHERE otp_required_for_login IS NULL}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddProjectViewToUsers < ActiveRecord::Migration
|
||||
class AddProjectViewToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :project_view, :integer, default: 0
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddCommitsCountToProject < ActiveRecord::Migration
|
||||
class AddCommitsCountToProject < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :projects, :commit_count, :integer, default: 0
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddUpdatedByToIssuablesAndNotes < ActiveRecord::Migration
|
||||
class AddUpdatedByToIssuablesAndNotes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :notes, :updated_by_id, :integer
|
||||
add_column :issues, :updated_by_id, :integer
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class CreateAbuseReports < ActiveRecord::Migration
|
||||
class CreateAbuseReports < ActiveRecord::Migration[4.2]
|
||||
DOWNTIME = false
|
||||
|
||||
def change
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# rubocop:disable all
|
||||
require 'yaml'
|
||||
|
||||
class AddSettingsImportSources < ActiveRecord::Migration
|
||||
class AddSettingsImportSources < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
unless column_exists?(:application_settings, :import_sources)
|
||||
add_column :application_settings, :import_sources, :text
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class RemoveOauthTokensFromUsers < ActiveRecord::Migration
|
||||
class RemoveOauthTokensFromUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_column :users, :github_access_token, :string
|
||||
remove_column :users, :gitlab_access_token, :string
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class DeduplicateUserIdentities < ActiveRecord::Migration
|
||||
class DeduplicateUserIdentities < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
execute 'DROP TABLE IF EXISTS tt_migration_DeduplicateUserIdentities;'
|
||||
execute 'CREATE TABLE tt_migration_DeduplicateUserIdentities AS SELECT id,provider,user_id FROM identities;'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddSentNotifications < ActiveRecord::Migration
|
||||
class AddSentNotifications < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :sent_notifications do |t|
|
||||
t.references :project
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddEnableSslVerification < ActiveRecord::Migration
|
||||
class AddEnableSslVerification < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :web_hooks, :enable_ssl_verification, :boolean, default: false
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddCiTables < ActiveRecord::Migration
|
||||
class AddCiTables < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table "ci_application_settings", force: true do |t|
|
||||
t.boolean "all_broken_builds"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddFastForwardOptionToProject < ActiveRecord::Migration
|
||||
class AddFastForwardOptionToProject < ActiveRecord::Migration[4.2]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
# Set this constant to true if this migration requires downtime.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddTemplateToLabel < ActiveRecord::Migration
|
||||
class AddTemplateToLabel < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :labels, :template, :boolean, default: false
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# rubocop:disable all
|
||||
class AddCiTags < ActiveRecord::Migration
|
||||
class AddCiTags < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table "ci_taggings", force: true do |t|
|
||||
t.integer "tag_id"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class EnableSslVerificationByDefault < ActiveRecord::Migration
|
||||
class EnableSslVerificationByDefault < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_column :web_hooks, :enable_ssl_verification, :boolean, default: true
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class EnableSslVerificationForWebHooks < ActiveRecord::Migration
|
||||
class EnableSslVerificationForWebHooks < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
execute("UPDATE web_hooks SET enable_ssl_verification = true")
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddHelpPageTextToApplicationSettings < ActiveRecord::Migration
|
||||
class AddHelpPageTextToApplicationSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :application_settings, :help_page_text, :text
|
||||
end
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue