Remove Geo::Fdw::Namespace model

Since GitLab 13.2 we don't rely on FDW query/models
parent 979be967
......@@ -10,7 +10,6 @@ module Geo
serialize :selective_sync_shards, Array # rubocop:disable Cop/ActiveRecordSerialize
has_many :geo_node_namespace_links, class_name: 'Geo::Fdw::GeoNodeNamespaceLink'
has_many :namespaces, class_name: 'Geo::Fdw::Namespace', through: :geo_node_namespace_links
end
end
end
......@@ -6,7 +6,6 @@ module Geo
self.table_name = Gitlab::Geo::Fdw.foreign_table_name('geo_node_namespace_links')
belongs_to :geo_node, class_name: 'Geo::Fdw::GeoNode', inverse_of: :namespaces
belongs_to :namespace, class_name: 'Geo::Fdw::Namespace', inverse_of: :geo_nodes
end
end
end
# frozen_string_literal: true
module Geo
module Fdw
class Namespace < ::Geo::BaseFdw
include Routable
self.primary_key = :id
self.inheritance_column = nil
self.table_name = Gitlab::Geo::Fdw.foreign_table_name('namespaces')
has_many :geo_node_namespace_links, class_name: 'Geo::Fdw::GeoNodeNamespaceLink'
has_many :geo_nodes, class_name: 'Geo::Fdw::GeoNode', through: :geo_node_namespace_links
belongs_to :parent, class_name: "Namespace"
end
end
end
......@@ -5,6 +5,5 @@ require 'spec_helper'
RSpec.describe Geo::Fdw::GeoNodeNamespaceLink, :geo, type: :model do
context 'relationships' do
it { is_expected.to belong_to(:geo_node).class_name('Geo::Fdw::GeoNode').inverse_of(:namespaces) }
it { is_expected.to belong_to(:namespace).class_name('Geo::Fdw::Namespace').inverse_of(:geo_nodes) }
end
end
......@@ -5,6 +5,5 @@ require 'spec_helper'
RSpec.describe Geo::Fdw::GeoNode, :geo, type: :model do
context 'relationships' do
it { is_expected.to have_many(:geo_node_namespace_links).class_name('Geo::Fdw::GeoNodeNamespaceLink') }
it { is_expected.to have_many(:namespaces).class_name('Geo::Fdw::Namespace').through(:geo_node_namespace_links) }
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Geo::Fdw::Namespace, :geo, type: :model do
context 'relationships' do
it { is_expected.to have_many(:geo_node_namespace_links).class_name('Geo::Fdw::GeoNodeNamespaceLink') }
it { is_expected.to have_many(:geo_nodes).class_name('Geo::Fdw::GeoNode').through(:geo_node_namespace_links) }
end
end
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