This commit is contained in:
张成
2026-03-18 15:25:34 +08:00
parent 5b671d320b
commit 37e39d35b8
17 changed files with 368 additions and 167 deletions

View File

@@ -0,0 +1,31 @@
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.TEXT, allowNull: false },
review_id: { type: DataTypes.STRING(64), allowNull: false },
author: { type: DataTypes.STRING(256), allowNull: true },
title: { type: DataTypes.TEXT, 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'] }
]
}
);
}