1 # == Schema Information
3 # Table name: relation_tags
5 # relation_id :integer default(0), not null, primary key
6 # k :string default(""), not null, primary key
7 # v :string default(""), not null
8 # version :integer not null, primary key
12 # relation_tags_id_fkey (relation_id => relations.relation_id)
15 class OldRelationTag < ActiveRecord::Base
16 self.table_name = "relation_tags"
17 self.primary_keys = "relation_id", "version", "k"
19 belongs_to :old_relation, :foreign_key => [:relation_id, :version]
21 validates :old_relation, :presence => true, :associated => true
22 validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }
23 validates :k, :uniqueness => { :scope => [:relation_id, :version] }