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