feat: api_key in user model
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user