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

38 lines
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { DataTypes } from 'sequelize';
export function define_amazon_product(sequelize) {
return sequelize.define(
'amazon_product',
{
id: { type: DataTypes.BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true },
asin: { type: DataTypes.STRING(32), allowNull: false },
url: { type: DataTypes.STRING(2048), allowNull: false },
title: { type: DataTypes.STRING(1024), allowNull: true },
price: { type: DataTypes.STRING(64), allowNull: true },
sku_json: { type: DataTypes.JSON, allowNull: true, comment: 'sku 结构化 JSON如 {color:[], size:[]}' },
brand_line: { type: DataTypes.STRING(512), allowNull: true },
brand_store_url: { type: DataTypes.STRING(2048), allowNull: true },
ac_badge: { type: DataTypes.STRING(128), allowNull: true },
bestseller_hint: { type: DataTypes.STRING(512), allowNull: true },
delivery_hint: { type: DataTypes.STRING(512), allowNull: true },
social_proof: { type: DataTypes.STRING(256), allowNull: true },
sustainability_hint: { type: DataTypes.STRING(256), allowNull: true },
rating_stars: { type: DataTypes.STRING(64), allowNull: true },
review_count_text: { type: DataTypes.STRING(64), allowNull: true },
main_image: { type: DataTypes.STRING(2048), allowNull: true },
images_json: { type: DataTypes.JSON, allowNull: true },
bullets_json: { type: DataTypes.JSON, allowNull: true },
product_info_json: { type: DataTypes.JSON, allowNull: true },
detail_extra_lines_json: { type: DataTypes.JSON, allowNull: true }
},
{
tableName: 'amazon_product',
indexes: [
{ unique: true, fields: ['asin'] },
{ fields: ['created_at'] },
{ fields: ['updated_at'] }
]
}
);
}