| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- const Sequelize = require('sequelize');
- module.exports = (sequelize, DataTypes) => {
- return wp_comments.init(sequelize, DataTypes);
- }
-
- class wp_comments extends Sequelize.Model {
- static init(sequelize, DataTypes) {
- super.init({
- comment_ID: {
- autoIncrement: true,
- type: DataTypes.BIGINT.UNSIGNED,
- allowNull: false,
- primaryKey: true
- },
- comment_post_ID: {
- type: DataTypes.BIGINT.UNSIGNED,
- allowNull: false,
- defaultValue: 0
- },
- comment_author: {
- type: DataTypes.TEXT,
- allowNull: false
- },
- comment_author_email: {
- type: DataTypes.STRING(100),
- allowNull: false,
- defaultValue: ""
- },
- comment_author_url: {
- type: DataTypes.STRING(200),
- allowNull: false,
- defaultValue: ""
- },
- comment_author_IP: {
- type: DataTypes.STRING(100),
- allowNull: false,
- defaultValue: ""
- },
- comment_date: {
- type: DataTypes.DATE,
- allowNull: false,
- defaultValue: "0000-00-00 00:00:00"
- },
- comment_date_gmt: {
- type: DataTypes.DATE,
- allowNull: false,
- defaultValue: "0000-00-00 00:00:00"
- },
- comment_content: {
- type: DataTypes.TEXT,
- allowNull: false
- },
- comment_karma: {
- type: DataTypes.INTEGER,
- allowNull: false,
- defaultValue: 0
- },
- comment_approved: {
- type: DataTypes.STRING(20),
- allowNull: false,
- defaultValue: "1"
- },
- comment_agent: {
- type: DataTypes.STRING(255),
- allowNull: false,
- defaultValue: ""
- },
- comment_type: {
- type: DataTypes.STRING(20),
- allowNull: false,
- defaultValue: "comment"
- },
- comment_parent: {
- type: DataTypes.BIGINT.UNSIGNED,
- allowNull: false,
- defaultValue: 0
- },
- user_id: {
- type: DataTypes.BIGINT.UNSIGNED,
- allowNull: false,
- defaultValue: 0
- }
- }, {
- sequelize,
- tableName: 'wp_comments',
- timestamps: false,
- indexes: [
- {
- name: "PRIMARY",
- unique: true,
- using: "BTREE",
- fields: [
- { name: "comment_ID" },
- ]
- },
- {
- name: "comment_post_ID",
- using: "BTREE",
- fields: [
- { name: "comment_post_ID" },
- ]
- },
- {
- name: "comment_approved_date_gmt",
- using: "BTREE",
- fields: [
- { name: "comment_approved" },
- { name: "comment_date_gmt" },
- ]
- },
- {
- name: "comment_date_gmt",
- using: "BTREE",
- fields: [
- { name: "comment_date_gmt" },
- ]
- },
- {
- name: "comment_parent",
- using: "BTREE",
- fields: [
- { name: "comment_parent" },
- ]
- },
- {
- name: "comment_author_email",
- using: "BTREE",
- fields: [
- { name: "comment_author_email", length: 10 },
- ]
- },
- ]
- });
- return wp_comments;
- }
- }
|