first commit
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Niolla
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is proprietary and confidential.
|
||||
* Unauthorized copying, modification, distribution, or use
|
||||
* of this file, via any medium, is strictly prohibited.
|
||||
*/
|
||||
|
||||
// app/models/profile.model.js
|
||||
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
const Profile = sequelize.define(
|
||||
"Profile",
|
||||
{
|
||||
profile_id: {
|
||||
type: DataTypes.STRING,
|
||||
primaryKey: true,
|
||||
},
|
||||
user_id: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
unique: true,
|
||||
collate: 'utf8mb4_general_ci'
|
||||
},
|
||||
theme: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
defaultValue: "light",
|
||||
},
|
||||
notificationsEnabled: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: true,
|
||||
},
|
||||
profilePicture_id: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
},
|
||||
backgroundImage_id: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
},
|
||||
dob: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true,
|
||||
},
|
||||
phone_number:{
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
tableName: "profiles",
|
||||
timestamps: true,
|
||||
},
|
||||
);
|
||||
|
||||
Profile.associate = (db) => {
|
||||
Profile.belongsTo(db.User, {
|
||||
foreignKey: "user_id",
|
||||
as: "user",
|
||||
});
|
||||
};
|
||||
|
||||
return Profile;
|
||||
};
|
||||
Reference in New Issue
Block a user