You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wp_links.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. const Sequelize = require('sequelize');
  2. module.exports = (sequelize, DataTypes) => {
  3. return wp_links.init(sequelize, DataTypes);
  4. }
  5. class wp_links extends Sequelize.Model {
  6. static init(sequelize, DataTypes) {
  7. super.init({
  8. link_id: {
  9. autoIncrement: true,
  10. type: DataTypes.BIGINT.UNSIGNED,
  11. allowNull: false,
  12. primaryKey: true
  13. },
  14. link_url: {
  15. type: DataTypes.STRING(255),
  16. allowNull: false,
  17. defaultValue: ""
  18. },
  19. link_name: {
  20. type: DataTypes.STRING(255),
  21. allowNull: false,
  22. defaultValue: ""
  23. },
  24. link_image: {
  25. type: DataTypes.STRING(255),
  26. allowNull: false,
  27. defaultValue: ""
  28. },
  29. link_target: {
  30. type: DataTypes.STRING(25),
  31. allowNull: false,
  32. defaultValue: ""
  33. },
  34. link_description: {
  35. type: DataTypes.STRING(255),
  36. allowNull: false,
  37. defaultValue: ""
  38. },
  39. link_visible: {
  40. type: DataTypes.STRING(20),
  41. allowNull: false,
  42. defaultValue: "Y"
  43. },
  44. link_owner: {
  45. type: DataTypes.BIGINT.UNSIGNED,
  46. allowNull: false,
  47. defaultValue: 1
  48. },
  49. link_rating: {
  50. type: DataTypes.INTEGER,
  51. allowNull: false,
  52. defaultValue: 0
  53. },
  54. link_updated: {
  55. type: DataTypes.DATE,
  56. allowNull: false,
  57. defaultValue: "0000-00-00 00:00:00"
  58. },
  59. link_rel: {
  60. type: DataTypes.STRING(255),
  61. allowNull: false,
  62. defaultValue: ""
  63. },
  64. link_notes: {
  65. type: DataTypes.TEXT,
  66. allowNull: false
  67. },
  68. link_rss: {
  69. type: DataTypes.STRING(255),
  70. allowNull: false,
  71. defaultValue: ""
  72. }
  73. }, {
  74. sequelize,
  75. tableName: 'wp_links',
  76. timestamps: false,
  77. indexes: [
  78. {
  79. name: "PRIMARY",
  80. unique: true,
  81. using: "BTREE",
  82. fields: [
  83. { name: "link_id" },
  84. ]
  85. },
  86. {
  87. name: "link_visible",
  88. using: "BTREE",
  89. fields: [
  90. { name: "link_visible" },
  91. ]
  92. },
  93. ]
  94. });
  95. return wp_links;
  96. }
  97. }