1 # frozen_string_literal: true
 
   3 # == Schema Information
 
   5 # Table name: node_tags
 
   7 #  node_id :bigint           not null, primary key
 
   8 #  version :bigint           not null, primary key
 
   9 #  k       :string           default(""), not null, primary key
 
  10 #  v       :string           default(""), not null
 
  14 #  node_tags_id_fkey  ([node_id, version] => nodes[node_id, version])
 
  17 class OldNodeTag < ApplicationRecord
 
  18   self.table_name = "node_tags"
 
  20   belongs_to :old_node, :foreign_key => [:node_id, :version], :inverse_of => :old_tags
 
  22   validates :old_node, :associated => true
 
  23   validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
 
  24   validates :k, :uniqueness => { :scope => [:node_id, :version] }