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:
@@ -4,15 +4,15 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class Branch extends Model { }
|
||||
|
||||
Branch.init({
|
||||
branchTypeId: {
|
||||
branch_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
regionId: {
|
||||
region_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
falukantUserId: {
|
||||
falukant_user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -27,7 +27,8 @@ Branch.init({
|
||||
{
|
||||
unique: true,
|
||||
fields: ['region_id', 'falukant_user_id']
|
||||
}
|
||||
,
|
||||
freezeTableName: true}
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -4,27 +4,27 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class BuyableHouse extends Model { }
|
||||
|
||||
BuyableHouse.init({
|
||||
roofCondition: {
|
||||
roof_condition: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100
|
||||
},
|
||||
floorCondition: {
|
||||
floor_condition: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100
|
||||
},
|
||||
wallCondition: {
|
||||
wall_condition: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100
|
||||
},
|
||||
windowCondition: {
|
||||
window_condition: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100
|
||||
},
|
||||
houseTypeId: {
|
||||
house_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
}
|
||||
@@ -35,6 +35,7 @@ BuyableHouse.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default BuyableHouse;
|
||||
|
||||
@@ -4,11 +4,11 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class BuyableStock extends Model { }
|
||||
|
||||
BuyableStock.init({
|
||||
regionId: {
|
||||
region_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
stockTypeId: {
|
||||
stock_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -23,6 +23,7 @@ BuyableStock.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default BuyableStock;
|
||||
|
||||
@@ -25,6 +25,7 @@ Candidate.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default Candidate;
|
||||
|
||||
@@ -5,19 +5,19 @@ class FalukantCharacter extends Model {}
|
||||
|
||||
FalukantCharacter.init(
|
||||
{
|
||||
userId: {
|
||||
user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
},
|
||||
regionId: {
|
||||
region_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
firstName: {
|
||||
first_name: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
lastName: {
|
||||
last_name: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -34,11 +34,11 @@ FalukantCharacter.init(
|
||||
allowNull: false,
|
||||
defaultValue: 100,
|
||||
},
|
||||
titleOfNobility: {
|
||||
title_of_nobility: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
moodId: {
|
||||
mood_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 1,
|
||||
@@ -51,7 +51,8 @@ FalukantCharacter.init(
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
}
|
||||
,
|
||||
freezeTableName: true}
|
||||
);
|
||||
|
||||
export default FalukantCharacter;
|
||||
|
||||
@@ -5,32 +5,32 @@ class ChildRelation extends Model {}
|
||||
|
||||
ChildRelation.init(
|
||||
{
|
||||
fatherCharacterId: {
|
||||
father_character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
motherCharacterId: {
|
||||
mother_character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
childCharacterId: {
|
||||
child_character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
fatherName: {
|
||||
father_name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
motherName: {
|
||||
mother_name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
nameSet: {
|
||||
name_set: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
default: false,
|
||||
},
|
||||
isHeir: {
|
||||
is_heir: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: true,
|
||||
default: false,
|
||||
|
||||
@@ -11,17 +11,17 @@ Credit.init({
|
||||
allowNull: false,
|
||||
},
|
||||
// noch offener Kreditbetrag
|
||||
remainingAmount: {
|
||||
remaining_amount: {
|
||||
type: DataTypes.DECIMAL(14,2),
|
||||
allowNull: false,
|
||||
},
|
||||
// Zinssatz als Prozentsatz (z.B. 3.5 für 3.5%)
|
||||
interestRate: {
|
||||
interest_rate: {
|
||||
type: DataTypes.DECIMAL(5,2),
|
||||
allowNull: false,
|
||||
},
|
||||
// Verknüpfung auf FalukantUser
|
||||
falukantUserId: {
|
||||
falukant_user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -32,6 +32,7 @@ Credit.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default Credit;
|
||||
|
||||
@@ -5,7 +5,7 @@ class DebtorsPrism extends Model {}
|
||||
|
||||
DebtorsPrism.init({
|
||||
// Verknüpfung auf FalukantCharacter
|
||||
characterId: {
|
||||
character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -16,6 +16,7 @@ DebtorsPrism.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default DebtorsPrism;
|
||||
|
||||
@@ -4,11 +4,11 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class Director extends Model { }
|
||||
|
||||
Director.init({
|
||||
directorCharacterId: {
|
||||
director_character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
employerUserId: {
|
||||
employer_user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -21,22 +21,22 @@ Director.init({
|
||||
allowNull: false,
|
||||
defaultValue: 100,
|
||||
},
|
||||
mayProduce: {
|
||||
may_produce: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: true,
|
||||
},
|
||||
maySell: {
|
||||
may_sell: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: true,
|
||||
},
|
||||
mayStartTransport: {
|
||||
may_start_transport: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: true,
|
||||
},
|
||||
lastSalaryPayout: {
|
||||
last_salary_payout: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
defaultValue: new Date(0)
|
||||
@@ -48,6 +48,7 @@ Director.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default Director;
|
||||
|
||||
@@ -4,15 +4,15 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class DirectorProposal extends Model { }
|
||||
|
||||
DirectorProposal.init({
|
||||
directorCharacterId: {
|
||||
director_character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
employerUserId: {
|
||||
employer_user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
proposedIncome: {
|
||||
proposed_income: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -23,6 +23,7 @@ DirectorProposal.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default DirectorProposal;
|
||||
|
||||
@@ -10,11 +10,11 @@ Election.init({
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
officeTypeId: {
|
||||
office_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
},
|
||||
regionId: {
|
||||
region_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
},
|
||||
@@ -22,7 +22,7 @@ Election.init({
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
},
|
||||
postsToFill: {
|
||||
posts_to_fill: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -33,6 +33,7 @@ Election.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default Election;
|
||||
|
||||
@@ -29,6 +29,7 @@ ElectionResult.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default ElectionResult;
|
||||
|
||||
@@ -21,7 +21,8 @@ FalukantCharacterTrait.init(
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
}
|
||||
,
|
||||
freezeTableName: true}
|
||||
);
|
||||
|
||||
export default FalukantCharacterTrait;
|
||||
|
||||
@@ -4,11 +4,11 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class Inventory extends Model { }
|
||||
|
||||
Inventory.init({
|
||||
stockId: {
|
||||
stock_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
productId: {
|
||||
product_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -20,7 +20,7 @@ Inventory.init({
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
producedAt: {
|
||||
produced_at: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
defaultValue: DataTypes.NOW,
|
||||
@@ -32,6 +32,7 @@ Inventory.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default Inventory;
|
||||
|
||||
@@ -5,31 +5,31 @@ class Learning extends Model {}
|
||||
|
||||
Learning.init(
|
||||
{
|
||||
learningRecipientId: {
|
||||
learning_recipient_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
productId: {
|
||||
product_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
},
|
||||
learnAllProducts: {
|
||||
learn_all_products: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false,
|
||||
},
|
||||
associatedFalukantUserId: {
|
||||
associated_falukant_user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
},
|
||||
associatedLearningCharacterId: {
|
||||
associated_learning_character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
},
|
||||
learningIsExecuted: {
|
||||
learning_is_executed: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false,
|
||||
@@ -42,7 +42,8 @@ Learning.init(
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
}
|
||||
,
|
||||
freezeTableName: true}
|
||||
);
|
||||
|
||||
export default Learning;
|
||||
|
||||
@@ -5,12 +5,12 @@ class MarriageProposal extends Model {}
|
||||
|
||||
MarriageProposal.init(
|
||||
{
|
||||
requesterCharacterId: {
|
||||
requester_character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
proposedCharacterId: {
|
||||
proposed_character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
onDelete: 'CASCADE',
|
||||
@@ -28,7 +28,8 @@ MarriageProposal.init(
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
}
|
||||
,
|
||||
freezeTableName: true}
|
||||
);
|
||||
|
||||
export default MarriageProposal;
|
||||
|
||||
@@ -25,6 +25,7 @@ OccupiedPoliticalOffice.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default OccupiedPoliticalOffice;
|
||||
|
||||
@@ -4,27 +4,27 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class Party extends Model {}
|
||||
|
||||
Party.init({
|
||||
partyTypeId: {
|
||||
party_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'party_type_id'
|
||||
},
|
||||
falukantUserId: {
|
||||
falukant_user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'falukant_user_id'
|
||||
},
|
||||
musicTypeId: {
|
||||
music_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'music_type'
|
||||
},
|
||||
banquetteTypeId: {
|
||||
banquette_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'banquette_type'
|
||||
},
|
||||
servantRatio: {
|
||||
servant_ratio: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'servant_ratio'
|
||||
@@ -41,6 +41,7 @@ Party.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default Party;
|
||||
@@ -4,12 +4,12 @@ import { sequelize } from '../../../utils/sequelize.js'
|
||||
class PartyInvitedNobility extends Model {}
|
||||
|
||||
PartyInvitedNobility.init({
|
||||
partyId: {
|
||||
party_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'party_id'
|
||||
},
|
||||
titleOfNobilityId: {
|
||||
title_of_nobility_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'title_of_nobility_id'
|
||||
@@ -21,6 +21,7 @@ PartyInvitedNobility.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true
|
||||
})
|
||||
,
|
||||
freezeTableName: true})
|
||||
|
||||
export default PartyInvitedNobility
|
||||
|
||||
@@ -10,15 +10,15 @@ PoliticalOffice.init({
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
officeTypeId: {
|
||||
office_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
characterId: {
|
||||
character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
regionId: {
|
||||
region_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -29,6 +29,7 @@ PoliticalOffice.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default PoliticalOffice;
|
||||
|
||||
@@ -4,11 +4,11 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class Knowledge extends Model { }
|
||||
|
||||
Knowledge.init({
|
||||
productId: {
|
||||
product_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
characterId: {
|
||||
character_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -27,7 +27,8 @@ Knowledge.init({
|
||||
hooks: {
|
||||
beforeCreate: (knowledge) => {
|
||||
knowledge.knowledge = Math.floor(Math.random() * 61) + 20;
|
||||
}
|
||||
,
|
||||
freezeTableName: true}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class Production extends Model { }
|
||||
|
||||
Production.init({
|
||||
branchId: {
|
||||
branch_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
productId: {
|
||||
product_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -16,7 +16,7 @@ Production.init({
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
startTimestamp: {
|
||||
start_timestamp: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
|
||||
@@ -28,6 +28,7 @@ Production.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default Production;
|
||||
|
||||
@@ -9,7 +9,7 @@ RegionData.init({
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
regionTypeId: {
|
||||
region_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
@@ -18,7 +18,7 @@ RegionData.init({
|
||||
schema: 'falukant_type'
|
||||
}
|
||||
},
|
||||
parentId: {
|
||||
parent_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
references: {
|
||||
@@ -39,6 +39,7 @@ RegionData.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default RegionData;
|
||||
|
||||
@@ -24,7 +24,7 @@ Relationship.init(
|
||||
},
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
relationshipTypeId: {
|
||||
relationship_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
onDelete: 'CASCADE',
|
||||
@@ -37,7 +37,7 @@ Relationship.init(
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
},
|
||||
nextStepProgress: {
|
||||
next_step_progress: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
defaultValue: 0,
|
||||
@@ -50,7 +50,8 @@ Relationship.init(
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
}
|
||||
,
|
||||
freezeTableName: true}
|
||||
);
|
||||
|
||||
export default Relationship;
|
||||
|
||||
@@ -4,12 +4,12 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class FalukantStock extends Model { }
|
||||
|
||||
FalukantStock.init({
|
||||
branchId: {
|
||||
branch_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 0
|
||||
},
|
||||
stockTypeId: {
|
||||
stock_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -24,6 +24,7 @@ FalukantStock.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default FalukantStock;
|
||||
|
||||
@@ -4,15 +4,15 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class TownProductWorth extends Model { }
|
||||
|
||||
TownProductWorth.init({
|
||||
productId: {
|
||||
product_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
regionId: {
|
||||
region_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
worthPercent: {
|
||||
worth_percent: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 0,
|
||||
@@ -27,7 +27,8 @@ TownProductWorth.init({
|
||||
hooks: {
|
||||
beforeCreate: (worthPercent) => {
|
||||
worthPercent.worthPercent = Math.floor(Math.random() * 20) + 40;
|
||||
}
|
||||
,
|
||||
freezeTableName: true}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class Underground extends Model { }
|
||||
|
||||
Underground.init({
|
||||
undergroundTypeId: {
|
||||
underground_type_id: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
performerId: {
|
||||
performer_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
victimId: {
|
||||
victim_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -31,6 +31,7 @@ Underground.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default Underground;
|
||||
|
||||
@@ -5,7 +5,7 @@ import RegionData from './region.js';
|
||||
class FalukantUser extends Model { }
|
||||
|
||||
FalukantUser.init({
|
||||
userId: {
|
||||
user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
@@ -22,17 +22,17 @@ FalukantUser.init({
|
||||
allowNull: false,
|
||||
defaultValue: 0.00,
|
||||
},
|
||||
creditAmount: {
|
||||
credit_amount: {
|
||||
type: DataTypes.DECIMAL(10, 2),
|
||||
allowNull: false,
|
||||
defaultValue: 0.00,
|
||||
},
|
||||
todayCreditTaken: {
|
||||
today_credit_taken: {
|
||||
type: DataTypes.DECIMAL(10, 2),
|
||||
allowNull: false,
|
||||
defaultValue: 0.00,
|
||||
},
|
||||
creditInterestRate: {
|
||||
credit_interest_rate: {
|
||||
type: DataTypes.DECIMAL(5, 2),
|
||||
allowNull: false,
|
||||
defaultValue: 0.00,
|
||||
@@ -42,7 +42,7 @@ FalukantUser.init({
|
||||
allowNull: false,
|
||||
defaultValue: 1,
|
||||
},
|
||||
mainBranchRegionId: {
|
||||
main_branch_region_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
references: {
|
||||
@@ -58,6 +58,7 @@ FalukantUser.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default FalukantUser;
|
||||
|
||||
@@ -4,32 +4,32 @@ import { sequelize } from '../../../utils/sequelize.js';
|
||||
class UserHouse extends Model { }
|
||||
|
||||
UserHouse.init({
|
||||
roofCondition: {
|
||||
roof_condition: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100
|
||||
},
|
||||
floorCondition: {
|
||||
floor_condition: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100
|
||||
},
|
||||
wallCondition: {
|
||||
wall_condition: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100
|
||||
},
|
||||
windowCondition: {
|
||||
window_condition: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100
|
||||
},
|
||||
houseTypeId: {
|
||||
house_type_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 1
|
||||
},
|
||||
userId: {
|
||||
user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 1
|
||||
@@ -41,6 +41,7 @@ UserHouse.init({
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
});
|
||||
,
|
||||
freezeTableName: true});
|
||||
|
||||
export default UserHouse;
|
||||
|
||||
@@ -11,11 +11,11 @@ Vote.init(
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
electionId: {
|
||||
election_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
candidateId: {
|
||||
candidate_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -24,7 +24,7 @@ Vote.init(
|
||||
allowNull: false,
|
||||
defaultValue: DataTypes.NOW,
|
||||
},
|
||||
falukantUserId: {
|
||||
falukant_user_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
@@ -40,7 +40,8 @@ Vote.init(
|
||||
{
|
||||
unique: true,
|
||||
fields: ['election_id', 'candidate_id'],
|
||||
},
|
||||
,
|
||||
freezeTableName: true},
|
||||
],
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user