Files
mv2_simple_crx/server/models/amazon_review.js
张成 aecb7944a8 1
2026-03-18 18:07:41 +08:00

32 lines
1.2 KiB
JavaScript

import { DataTypes } from 'sequelize';
export function define_amazon_review(sequelize) {
return sequelize.define(
'amazon_review',
{
id: { type: DataTypes.BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true },
asin: { type: DataTypes.STRING(32), allowNull: true },
url: { type: DataTypes.STRING(2048), allowNull: false },
review_id: { type: DataTypes.STRING(64), allowNull: false },
author: { type: DataTypes.STRING(256), allowNull: true },
title: { type: DataTypes.STRING(512), allowNull: true },
body: { type: DataTypes.TEXT('long'), allowNull: true },
rating_text: { type: DataTypes.STRING(64), allowNull: true },
review_date: { type: DataTypes.STRING(128), allowNull: true },
review_index: { type: DataTypes.INTEGER, allowNull: true },
batch_key: { type: DataTypes.STRING(64), allowNull: false },
batch_total: { type: DataTypes.INTEGER, allowNull: true },
batch_limit: { type: DataTypes.INTEGER, allowNull: true }
},
{
tableName: 'amazon_review',
indexes: [
{ unique: true, fields: ['review_id'] },
{ fields: ['asin'] },
{ fields: ['batch_key'] },
{ fields: ['created_at'] }
]
}
);
}