2019-02-15 15:39:39 +05:30
|
|
|
class CreateRemoteMirrors < ActiveRecord::Migration[4.2]
|
2018-10-15 14:42:47 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
# rubocop:disable Migration/PreventStrings
|
2018-10-15 14:42:47 +05:30
|
|
|
def up
|
|
|
|
return if table_exists?(:remote_mirrors)
|
|
|
|
|
|
|
|
create_table :remote_mirrors do |t|
|
|
|
|
t.references :project, index: true, foreign_key: { on_delete: :cascade }
|
|
|
|
t.string :url
|
|
|
|
t.boolean :enabled, default: true
|
|
|
|
t.string :update_status
|
2020-04-22 19:07:51 +05:30
|
|
|
t.datetime :last_update_at # rubocop:disable Migration/Datetime
|
|
|
|
t.datetime :last_successful_update_at # rubocop:disable Migration/Datetime
|
|
|
|
t.datetime :last_update_started_at # rubocop:disable Migration/Datetime
|
2018-10-15 14:42:47 +05:30
|
|
|
t.string :last_error
|
|
|
|
t.boolean :only_protected_branches, default: false, null: false
|
|
|
|
t.string :remote_name
|
2020-05-24 23:13:21 +05:30
|
|
|
t.text :encrypted_credentials # rubocop:disable Migration/AddLimitToTextColumns
|
2018-10-15 14:42:47 +05:30
|
|
|
t.string :encrypted_credentials_iv
|
|
|
|
t.string :encrypted_credentials_salt
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
# rubocop:disable Migration/Timestamps
|
2018-10-15 14:42:47 +05:30
|
|
|
t.timestamps null: false
|
|
|
|
end
|
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
# rubocop:enable Migration/PreventStrings
|
2018-10-15 14:42:47 +05:30
|
|
|
|
|
|
|
def down
|
2019-09-04 21:01:54 +05:30
|
|
|
# ee/db/migrate/20160321161032_create_remote_mirrors_ee.rb will remove the table
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
|
|
|
end
|