diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-05-29 12:43:06 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-05-29 13:29:29 +0300 |
commit | 4a344a154949fc9ba72cd6e122fe4e24d952ff3f (patch) | |
tree | a93e02e87e51f9b35a5af0894ad8e7c1fb1c4c23 /db | |
parent | c5adf04cd69035a7a1737df8c2303bc228ea4089 (diff) |
Adds migration to ensure all remote mirror columns get created
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180529093006_ensure_remote_mirror_columns.rb | 24 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/db/migrate/20180529093006_ensure_remote_mirror_columns.rb b/db/migrate/20180529093006_ensure_remote_mirror_columns.rb new file mode 100644 index 00000000000..290416cb61c --- /dev/null +++ b/db/migrate/20180529093006_ensure_remote_mirror_columns.rb @@ -0,0 +1,24 @@ +class EnsureRemoteMirrorColumns < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column :remote_mirrors, :last_update_started_at, :datetime unless column_exists?(:remote_mirrors, :last_update_started_at) + add_column :remote_mirrors, :remote_name, :string unless column_exists?(:remote_mirrors, :remote_name) + + unless column_exists?(:remote_mirrors, :only_protected_branches) + add_column_with_default(:remote_mirrors, + :only_protected_branches, + :boolean, + default: false, + allow_null: false) + end + end + + def down + # db/migrate/20180503131624_create_remote_mirrors.rb will remove the table + end +end diff --git a/db/schema.rb b/db/schema.rb index a3e33c1d9aa..932b7f8da02 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180524132016) do +ActiveRecord::Schema.define(version: 20180529093006) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" |