Advertisement
Guest User

models/user.js

a guest
Mar 16th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. 'use strict';
  2. module.exports = function(sequelize, DataTypes) {
  3. var User = sequelize.define('User', {
  4. id: {
  5. allowNull: false,
  6. autoIncrement: true,
  7. primaryKey: true,
  8. type: DataTypes.INTEGER
  9. },
  10. fullname:{
  11. type:DataTypes.STRING,
  12. allowNull:false
  13. },
  14. email: {
  15. type:DataTypes.STRING,
  16. allowNull:false
  17. },
  18. password: {
  19. type:DataTypes.STRING,
  20. allowNull:false
  21. },
  22. fb_id:{
  23. type:DataTypes.STRING
  24. },
  25. fb_token:{
  26. type:DataTypes.STRING
  27. },
  28. fb_token_expired:{
  29. type:DataTypes.DATE
  30. },
  31. google_id:{
  32. type:DataTypes.STRING
  33. },
  34. google_token:{
  35. type:DataTypes.STRING
  36. },
  37. google_token_expired:{
  38. type:DataTypes.DATE
  39. },
  40. avatar:{
  41. type:DataTypes.STRING,
  42. allowNull:false
  43.  
  44. },
  45. phone:{
  46. type:DataTypes.STRING,
  47. allowNull:false
  48.  
  49. },
  50. address_id:{
  51. type:DataTypes.INTEGER,
  52. allowNull:false
  53.  
  54. },
  55. is_buyer:{
  56. type:DataTypes.INTEGER,
  57. allowNull:false
  58.  
  59. },
  60. is_seller:{
  61. type:DataTypes.INTEGER,
  62. allowNull:false
  63.  
  64. },
  65. is_affiliate:{
  66. type:DataTypes.INTEGER,
  67. allowNull:false
  68.  
  69. },
  70. is_active: {
  71. type:DataTypes.INTEGER,
  72. allowNull:false
  73. },
  74. current_balance: {
  75. type:DataTypes.NUMERIC
  76. },
  77. last_login:{
  78. type:DataTypes.DATE
  79. },
  80. }, {
  81. timestamp:true,
  82. // lastlogin:"last_login",
  83. createdAt:"created_at",
  84. updatedAt:"updated_at",
  85. tableName: 'users',
  86. classMethods: {
  87. associate: function(models) {
  88. // User.hasMany(models.Topup, { foreignKey:'user_id'} )
  89. }
  90. }
  91. });
  92. return User;
  93. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement