diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20191216094119_add_id_to_plan_limits.rb | 13 | ||||
-rw-r--r-- | db/migrate/20191216183531_add_project_hooks_to_plan_limits.rb | 9 | ||||
-rw-r--r-- | db/migrate/20191216183532_insert_project_hooks_plan_limits.rb | 25 | ||||
-rw-r--r-- | db/schema.rb | 3 |
4 files changed, 49 insertions, 1 deletions
diff --git a/db/migrate/20191216094119_add_id_to_plan_limits.rb b/db/migrate/20191216094119_add_id_to_plan_limits.rb new file mode 100644 index 00000000000..05ebd900df3 --- /dev/null +++ b/db/migrate/20191216094119_add_id_to_plan_limits.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddIdToPlanLimits < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def up + add_column(:plan_limits, :id, :primary_key) unless column_exists?(:plan_limits, :id) + end + + def down + remove_column(:plan_limits, :id) + end +end diff --git a/db/migrate/20191216183531_add_project_hooks_to_plan_limits.rb b/db/migrate/20191216183531_add_project_hooks_to_plan_limits.rb new file mode 100644 index 00000000000..c56b6edf029 --- /dev/null +++ b/db/migrate/20191216183531_add_project_hooks_to_plan_limits.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddProjectHooksToPlanLimits < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + add_column(:plan_limits, :project_hooks, :integer, default: 0, null: false) + end +end diff --git a/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb b/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb new file mode 100644 index 00000000000..b2c0121dd24 --- /dev/null +++ b/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class InsertProjectHooksPlanLimits < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + return unless Gitlab.com? + + create_or_update_plan_limit('project_hooks', 'free', 10) + create_or_update_plan_limit('project_hooks', 'bronze', 20) + create_or_update_plan_limit('project_hooks', 'silver', 30) + create_or_update_plan_limit('project_hooks', 'gold', 100) + end + + def down + return unless Gitlab.com? + + create_or_update_plan_limit('project_hooks', 'free', 0) + create_or_update_plan_limit('project_hooks', 'bronze', 0) + create_or_update_plan_limit('project_hooks', 'silver', 0) + create_or_update_plan_limit('project_hooks', 'gold', 0) + end +end diff --git a/db/schema.rb b/db/schema.rb index 7b0ecce825c..d3e9f66c388 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_12_14_175727) do +ActiveRecord::Schema.define(version: 2019_12_16_183532) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -2987,6 +2987,7 @@ ActiveRecord::Schema.define(version: 2019_12_14_175727) do t.integer "ci_active_pipelines", default: 0, null: false t.integer "ci_pipeline_size", default: 0, null: false t.integer "ci_active_jobs", default: 0, null: false + t.integer "project_hooks", default: 0, null: false t.index ["plan_id"], name: "index_plan_limits_on_plan_id", unique: true end |