import { DataTypes } from 'sequelize';
import sequelize from '../database.js';

const ClubDistributionGroupMember = sequelize.define('ClubDistributionGroupMember', {
  id: {
    type: DataTypes.BIGINT,
    primaryKey: true,
    autoIncrement: true,
    allowNull: false,
  },
  groupId: {
    type: DataTypes.BIGINT,
    allowNull: false,
    field: 'group_id',
  },
  memberId: {
    type: DataTypes.BIGINT,
    allowNull: false,
    field: 'member_id',
  },
}, {
  underscored: true,
  tableName: 'club_distribution_group_members',
  timestamps: true,
  indexes: [
    {
      unique: true,
      fields: ['group_id', 'member_id'],
    },
  ],
});

export default ClubDistributionGroupMember;
