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
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
......@@ -13,7 +13,6 @@ def up
FROM projects
WHERE = ci_variables.project_id
OR ci_variables.project_id IS NULL
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}" }
project factory: :empty_project
require 'spec_helper'
describe Ci::Variable, models: true do
subject { }
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