- Created new chat schema in the database. - Implemented chat room model with necessary fields (title, ownerId, roomTypeId, etc.). - Added room type model and rights model for chat functionality. - Developed API endpoints for managing chat rooms, including create, edit, and delete operations. - Integrated chat room management into the admin interface with a dedicated view and dialog for room creation/editing. - Added internationalization support for chat room management UI. - Implemented autocomplete for victim selection in underground activities. - Enhanced the underground view with new activity types and political target selection.
42 lines
964 B
JavaScript
42 lines
964 B
JavaScript
import { DataTypes } from 'sequelize';
|
|
import { sequelize } from '../../utils/sequelize.js';
|
|
|
|
const ChatUser = sequelize.define('ChatUser', {
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
primaryKey: true,
|
|
autoIncrement: true,
|
|
},
|
|
falukant_user_id: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
comment: 'Verknüpfung zu community.falukant_user',
|
|
},
|
|
display_name: {
|
|
type: DataTypes.STRING(64),
|
|
allowNull: false,
|
|
},
|
|
color: {
|
|
type: DataTypes.STRING(16), // z.B. Hex-Code
|
|
allowNull: false,
|
|
defaultValue: '#000000',
|
|
},
|
|
show_gender: {
|
|
type: DataTypes.BOOLEAN,
|
|
allowNull: false,
|
|
defaultValue: true,
|
|
},
|
|
show_age: {
|
|
type: DataTypes.BOOLEAN,
|
|
allowNull: false,
|
|
defaultValue: true,
|
|
},
|
|
}, {
|
|
schema: 'chat',
|
|
tableName: 'user',
|
|
timestamps: true,
|
|
underscored: true,
|
|
});
|
|
|
|
export default ChatUser;
|