feat: Anpassung der Datenbankmodelle zur Unterstützung von snake_case und Einführung von freezeTableName

- Aktualisierung der Modelle in verschiedenen Bereichen, um die Feldnamen im snake_case-Format zu verwenden.
- Hinzufügen der Option freezeTableName zu den Modellen, um die Tabellennamen in der Datenbank unverändert zu lassen.
- Verbesserung der Konsistenz und Lesbarkeit des Codes durch einheitliche Namenskonventionen.
This commit is contained in:
Torsten Schulz (local)
2025-08-23 06:04:23 +02:00
parent e168adeb51
commit 66818cc728
114 changed files with 548 additions and 380 deletions

View File

@@ -11,20 +11,20 @@ const Room = sequelize.define('Room', {
type: DataTypes.TEXT,
allowNull: false,
},
ownerId: {
owner_id: {
type: DataTypes.INTEGER,
allowNull: true, // kann null sein, wenn system-owned
},
roomTypeId: {
room_type_id: {
type: DataTypes.INTEGER,
allowNull: true,
},
isPublic: {
is_public: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true,
},
genderRestrictionId: {
gender_restriction_id: {
type: DataTypes.INTEGER,
allowNull: true,
},
@@ -32,24 +32,24 @@ const Room = sequelize.define('Room', {
type: DataTypes.STRING,
allowNull: true,
},
minAge: {
min_age: {
type: DataTypes.INTEGER,
allowNull: true,
},
maxAge: {
max_age: {
type: DataTypes.INTEGER,
allowNull: true,
},
passwordHash: {
password_hash: {
type: DataTypes.TEXT,
allowNull: true,
},
friendsOfOwnerOnly: {
friends_of_owner_only: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
requiredUserRightId: {
required_user_right_id: {
type: DataTypes.INTEGER,
allowNull: true,
},
@@ -62,7 +62,8 @@ const Room = sequelize.define('Room', {
{
name: 'idx_chat_room_owner',
fields: ['owner_id'],
},
,
freezeTableName: true},
],
});