feat: api_key in user model

This commit is contained in:
karishmas6
2024-09-26 17:13:57 +05:30
parent 25c9265f59
commit e847646fb6

View File

@@ -5,6 +5,7 @@ interface UserAttributes {
id: number;
email: string;
password: string;
api_key?: string | null;
}
// Optional fields for creating a new user
@@ -14,6 +15,7 @@ class User extends Model<UserAttributes, UserCreationAttributes> implements User
public id!: number;
public email!: string;
public password!: string;
public api_key!: string | null;
}
User.init(
@@ -35,6 +37,10 @@ User.init(
type: DataTypes.STRING,
allowNull: false,
},
api_key: {
type: DataTypes.STRING,
allowNull: true,
},
},
{
sequelize,