diff options
Diffstat (limited to 'db/post_migrate/20191021101942_remove_empty_github_service_templates.rb')
-rw-r--r-- | db/post_migrate/20191021101942_remove_empty_github_service_templates.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb b/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb deleted file mode 100644 index 64abe93b3e8..00000000000 --- a/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -## It's expected to delete one record on GitLab.com -# -class RemoveEmptyGithubServiceTemplates < ActiveRecord::Migration[5.2] - DOWNTIME = false - - class Service < ActiveRecord::Base - self.table_name = 'services' - self.inheritance_column = :_type_disabled - - serialize :properties, JSON - end - - def up - relationship.where(properties: {}).delete_all - end - - def down - relationship.find_or_create_by!(properties: {}) - end - - private - - def relationship - RemoveEmptyGithubServiceTemplates::Service.where(template: true, type: 'GithubService') - end -end |