This instance will be upgraded to Heptapod 0.26.0rc1 on 2021-10-26 at 14:30 UTC+2 (a few minutes of down time)

Commit d922f545 authored by Z.J. van de Weg's avatar Z.J. van de Weg
Browse files

Remove rails dependent: :destroy statement

Enforced by the database, and no callbacks need to be called.

Combined with 7b9b2c6099 and 294a8b8a6d this resolves
gitlab-org/gitlab-ce#31799
parent d308ce695119
......@@ -175,7 +175,7 @@ def update_forks_visibility_level
has_many :builds, class_name: 'Ci::Build' # the builds are created from the commit_statuses
has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject'
has_many :runners, through: :runner_projects, source: :runner, class_name: 'Ci::Runner'
has_many :variables, dependent: :destroy, class_name: 'Ci::Variable'
has_many :variables, class_name: 'Ci::Variable'
has_many :triggers, dependent: :destroy, class_name: 'Ci::Trigger'
has_many :environments, dependent: :destroy
has_many :deployments, dependent: :destroy
......
---
title: Cleanup ci_variables schema and table
merge_request:
author:
......@@ -13,7 +13,6 @@ def up
FROM projects
WHERE projects.id = ci_variables.project_id
)
OR ci_variables.project_id IS NULL
SQL
add_concurrent_foreign_key(:ci_variables, :projects, column: :project_id)
......
......@@ -2,5 +2,7 @@
factory :ci_variable, class: Ci::Variable do
sequence(:key) { |n| "VARIABLE_#{n}" }
value 'VARIABLE_VALUE'
project factory: :empty_project
end
end
require 'spec_helper'
describe Ci::Variable, models: true do
subject { Ci::Variable.new }
subject { build(:ci_variable) }
let(:secret_value) { 'secret' }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment