Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/rentals.picotech.app/public_html/server/models/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import sequelize from '../config/database.js';
import User from './User.js';
import Building from './Building.js';
import Floor from './Floor.js';
import Room from './Room.js';
import Bed from './Bed.js';
import Renter from './Renter.js';
import RenterDocument from './RenterDocument.js';
import RentPayment from './RentPayment.js';
import Maintenance from './Maintenance.js';
import Expense from './Expense.js';
import Notice from './Notice.js';
import Visitor from './Visitor.js';
import Settings from './Settings.js';
import Activity from './Activity.js';
import Category from './Category.js';
// Define associations
Building.hasMany(Floor, { foreignKey: 'building_id', as: 'buildingFloors' });
Floor.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });
Floor.hasMany(Room, { foreignKey: 'floor_id', as: 'rooms' });
Room.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });
Room.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });
Room.hasMany(Bed, { foreignKey: 'room_id', as: 'beds' });
Bed.belongsTo(Room, { foreignKey: 'room_id', as: 'room' });
Bed.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });
Bed.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });
Bed.hasOne(Renter, { foreignKey: 'bed_id', as: 'renter' });
Renter.belongsTo(Bed, { foreignKey: 'bed_id', as: 'bed' });
Renter.belongsTo(Room, { foreignKey: 'room_id', as: 'room' });
Renter.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });
Renter.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });
Renter.hasMany(RenterDocument, { foreignKey: 'renter_id', as: 'documents' });
RenterDocument.belongsTo(Renter, { foreignKey: 'renter_id', as: 'renter' });
Renter.hasMany(RentPayment, { foreignKey: 'renter_id', as: 'payments' });
RentPayment.belongsTo(Renter, { foreignKey: 'renter_id', as: 'renter' });
Building.hasMany(Maintenance, { foreignKey: 'building_id', as: 'maintenanceRequests' });
Maintenance.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });
Floor.hasMany(Maintenance, { foreignKey: 'floor_id', as: 'maintenanceRequests' });
Maintenance.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });
Room.hasMany(Maintenance, { foreignKey: 'room_id', as: 'maintenanceRequests' });
Maintenance.belongsTo(Room, { foreignKey: 'room_id', as: 'room' });
Building.hasMany(Expense, { foreignKey: 'building_id', as: 'expenses' });
Expense.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });
Building.hasMany(Notice, { foreignKey: 'building_id', as: 'notices' });
Notice.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });
Floor.hasMany(Notice, { foreignKey: 'floor_id', as: 'notices' });
Notice.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });
// Renter.hasMany(Visitor, { foreignKey: 'visiting_renter_id', as: 'visitors' });
// Visitor.belongsTo(Renter, { foreignKey: 'visiting_renter_id', as: 'visitingRenter' });
Building.hasMany(Visitor, { foreignKey: 'building_id', as: 'visitors' });
Visitor.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });
Room.hasOne(Renter, { foreignKey: 'room_id', as: 'renters' });
export {
sequelize,
User,
Building,
Floor,
Room,
Bed,
Renter,
RenterDocument,
RentPayment,
Maintenance,
Expense,
Notice,
Visitor,
Settings,
Activity,
Category,
}; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0059 ]-- |