import {
  Entity,
  PrimaryColumn,
  Column,
  Index
} from 'typeorm';

@Entity('server_memberships')
export class ServerMembershipEntity {
  @PrimaryColumn('text')
  id!: string;

  @Index()
  @Column('text')
  serverId!: string;

  @Index()
  @Column('text')
  userId!: string;

  @Column('integer')
  joinedAt!: number;

  @Column('integer')
  lastAccessAt!: number;
}
