narinder1231 commited on
Commit
099ffb7
·
1 Parent(s): ad62c47

add password in user model

Browse files
src/db/migrations/20240710113255-create-user-table.js CHANGED
@@ -35,6 +35,11 @@ module.exports = {
35
  allowNull: false
36
  },
37
 
 
 
 
 
 
38
  created_at: {
39
  type: Sequelize.DATE
40
  },
 
35
  allowNull: false
36
  },
37
 
38
+ password: {
39
+ type: Sequelize.STRING,
40
+ allowNull: false
41
+ },
42
+
43
  created_at: {
44
  type: Sequelize.DATE
45
  },
src/models/users.ts CHANGED
@@ -15,6 +15,7 @@ class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> i
15
  declare email: string;
16
  declare role_id: number;
17
  declare status: string;
 
18
 
19
  }
20
 
@@ -50,6 +51,12 @@ User.init(
50
  type: DataTypes.STRING,
51
  allowNull: false,
52
  },
 
 
 
 
 
 
53
  },
54
 
55
  {
 
15
  declare email: string;
16
  declare role_id: number;
17
  declare status: string;
18
+ declare password: string;
19
 
20
  }
21
 
 
51
  type: DataTypes.STRING,
52
  allowNull: false,
53
  },
54
+
55
+ password: {
56
+ type: DataTypes.STRING,
57
+ allowNull: false,
58
+ },
59
+
60
  },
61
 
62
  {
src/shared/interfaces/user.interface.ts CHANGED
@@ -1,7 +1,8 @@
1
  export interface UserInterface {
2
- id?: number; // Optional for creation
3
  name: string;
4
  email: string;
5
  role_id: number;
6
  status: string;
 
7
  }
 
1
  export interface UserInterface {
2
+ id?: number;
3
  name: string;
4
  email: string;
5
  role_id: number;
6
  status: string;
7
+ password: string;
8
  }