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

const Friendship = sequelize.define('friendship', {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    user1Id: {
        type: DataTypes.INTEGER,
        allowNull: false
    },
    user2Id: {
        type: DataTypes.INTEGER,
        allowNull: false
    },
    accepted: {
        type: DataTypes.BOOLEAN,
        defaultValue: false
    },
    denied: {
        type: DataTypes.BOOLEAN,
        defaultValue: false
    },
    withdrawn: {
        type: DataTypes.BOOLEAN,
        defaultValue: false
    }
}, {
    tableName: 'friendship',
    schema: 'community',
    underscored: true,
    timestamps: true});

export default Friendship;
