address.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* indent size: 2 */
  2. module.exports = app => {
  3. const DataTypes = app.Sequelize;
  4. const Model = app.model.define('Address', {
  5. address_id: {
  6. type: DataTypes.INTEGER(10).UNSIGNED,
  7. allowNull: false,
  8. primaryKey: true,
  9. autoIncrement: true
  10. },
  11. user_id: {
  12. type: DataTypes.INTEGER(10).UNSIGNED,
  13. allowNull: true
  14. },
  15. uname: {
  16. type: DataTypes.STRING(255),
  17. allowNull: true
  18. },
  19. mobile: {
  20. type: DataTypes.STRING(11),
  21. allowNull: true
  22. },
  23. province_id: {
  24. type: DataTypes.INTEGER(10).UNSIGNED,
  25. allowNull: true
  26. },
  27. province_name: {
  28. type: DataTypes.STRING(255),
  29. allowNull: true
  30. },
  31. city_id: {
  32. type: DataTypes.INTEGER(10).UNSIGNED,
  33. allowNull: true
  34. },
  35. city_name: {
  36. type: DataTypes.STRING(255),
  37. allowNull: true
  38. },
  39. county_id: {
  40. type: DataTypes.INTEGER(10).UNSIGNED,
  41. allowNull: true
  42. },
  43. county_name: {
  44. type: DataTypes.STRING(255),
  45. allowNull: true
  46. },
  47. address: {
  48. type: DataTypes.STRING(255),
  49. allowNull: true
  50. },
  51. is_use: {
  52. type: DataTypes.INTEGER(1).UNSIGNED,
  53. allowNull: true
  54. },
  55. update_time: {
  56. type: DataTypes.TIME
  57. },
  58. create_time: {
  59. type: DataTypes.DATE,
  60. allowNull: true
  61. }
  62. }, {
  63. tableName: 'szj_address'
  64. });
  65. Model.associate = function() {
  66. }
  67. //同步:没有就新建,有就不变
  68. Model.sync();
  69. return Model;
  70. };