Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

wp_comments.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. const Sequelize = require('sequelize');
  2. module.exports = (sequelize, DataTypes) => {
  3. return wp_comments.init(sequelize, DataTypes);
  4. }
  5. class wp_comments extends Sequelize.Model {
  6. static init(sequelize, DataTypes) {
  7. super.init({
  8. comment_ID: {
  9. autoIncrement: true,
  10. type: DataTypes.BIGINT.UNSIGNED,
  11. allowNull: false,
  12. primaryKey: true
  13. },
  14. comment_post_ID: {
  15. type: DataTypes.BIGINT.UNSIGNED,
  16. allowNull: false,
  17. defaultValue: 0
  18. },
  19. comment_author: {
  20. type: DataTypes.TEXT,
  21. allowNull: false
  22. },
  23. comment_author_email: {
  24. type: DataTypes.STRING(100),
  25. allowNull: false,
  26. defaultValue: ""
  27. },
  28. comment_author_url: {
  29. type: DataTypes.STRING(200),
  30. allowNull: false,
  31. defaultValue: ""
  32. },
  33. comment_author_IP: {
  34. type: DataTypes.STRING(100),
  35. allowNull: false,
  36. defaultValue: ""
  37. },
  38. comment_date: {
  39. type: DataTypes.DATE,
  40. allowNull: false,
  41. defaultValue: "0000-00-00 00:00:00"
  42. },
  43. comment_date_gmt: {
  44. type: DataTypes.DATE,
  45. allowNull: false,
  46. defaultValue: "0000-00-00 00:00:00"
  47. },
  48. comment_content: {
  49. type: DataTypes.TEXT,
  50. allowNull: false
  51. },
  52. comment_karma: {
  53. type: DataTypes.INTEGER,
  54. allowNull: false,
  55. defaultValue: 0
  56. },
  57. comment_approved: {
  58. type: DataTypes.STRING(20),
  59. allowNull: false,
  60. defaultValue: "1"
  61. },
  62. comment_agent: {
  63. type: DataTypes.STRING(255),
  64. allowNull: false,
  65. defaultValue: ""
  66. },
  67. comment_type: {
  68. type: DataTypes.STRING(20),
  69. allowNull: false,
  70. defaultValue: "comment"
  71. },
  72. comment_parent: {
  73. type: DataTypes.BIGINT.UNSIGNED,
  74. allowNull: false,
  75. defaultValue: 0
  76. },
  77. user_id: {
  78. type: DataTypes.BIGINT.UNSIGNED,
  79. allowNull: false,
  80. defaultValue: 0
  81. }
  82. }, {
  83. sequelize,
  84. tableName: 'wp_comments',
  85. timestamps: false,
  86. indexes: [
  87. {
  88. name: "PRIMARY",
  89. unique: true,
  90. using: "BTREE",
  91. fields: [
  92. { name: "comment_ID" },
  93. ]
  94. },
  95. {
  96. name: "comment_post_ID",
  97. using: "BTREE",
  98. fields: [
  99. { name: "comment_post_ID" },
  100. ]
  101. },
  102. {
  103. name: "comment_approved_date_gmt",
  104. using: "BTREE",
  105. fields: [
  106. { name: "comment_approved" },
  107. { name: "comment_date_gmt" },
  108. ]
  109. },
  110. {
  111. name: "comment_date_gmt",
  112. using: "BTREE",
  113. fields: [
  114. { name: "comment_date_gmt" },
  115. ]
  116. },
  117. {
  118. name: "comment_parent",
  119. using: "BTREE",
  120. fields: [
  121. { name: "comment_parent" },
  122. ]
  123. },
  124. {
  125. name: "comment_author_email",
  126. using: "BTREE",
  127. fields: [
  128. { name: "comment_author_email", length: 10 },
  129. ]
  130. },
  131. ]
  132. });
  133. return wp_comments;
  134. }
  135. }