1 # == Schema Information
3 # Table name: relation_members
5 # relation_id :bigint(8) not null, primary key
6 # member_type :enum not null
7 # member_id :bigint(8) not null
8 # member_role :string not null
9 # version :bigint(8) default(0), not null, primary key
10 # sequence_id :integer default(0), not null, primary key
14 # relation_members_member_idx (member_type,member_id)
18 # relation_members_id_fkey (relation_id => relations.relation_id)
21 class OldRelationMember < ApplicationRecord
22 self.table_name = "relation_members"
23 self.primary_keys = "relation_id", "version", "sequence_id"
25 belongs_to :old_relation, :foreign_key => [:relation_id, :version], :inverse_of => :old_members
26 # A bit messy, referring to the current tables, should do for the data browser for now
27 belongs_to :member, :polymorphic => true
29 validates :member_role, :allow_blank => true, :length => { :maximum => 255 }, :characters => true