Friendship management added

This commit is contained in:
Torsten Schulz
2024-10-27 13:14:05 +01:00
parent f74a16e58e
commit 7f8709516d
13 changed files with 406 additions and 31 deletions

View File

@@ -0,0 +1,37 @@
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;