]> git.openstreetmap.org Git - rails.git/blob - app/models/old_relation_tag.rb
Merge pull request #6394 from openstreetmap/dependabot/github_actions/ruby/setup...
[rails.git] / app / models / old_relation_tag.rb
1 # frozen_string_literal: true
2
3 # == Schema Information
4 #
5 # Table name: relation_tags
6 #
7 #  relation_id :bigint           not null, primary key
8 #  k           :string           default(""), not null, primary key
9 #  v           :string           default(""), not null
10 #  version     :bigint           not null, primary key
11 #
12 # Foreign Keys
13 #
14 #  relation_tags_id_fkey  ([relation_id, version] => relations[relation_id, version])
15 #
16
17 class OldRelationTag < ApplicationRecord
18   self.table_name = "relation_tags"
19
20   belongs_to :old_relation, :foreign_key => [:relation_id, :version], :inverse_of => :old_tags
21
22   validates :old_relation, :associated => true
23   validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
24   validates :k, :uniqueness => { :scope => [:relation_id, :version] }
25 end