40 lines
1.8 KiB
JavaScript
40 lines
1.8 KiB
JavaScript
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.TEXT, allowNull: false },
|
|
title: { type: DataTypes.TEXT, allowNull: true },
|
|
price: { type: DataTypes.STRING(64), allowNull: true },
|
|
sku: { type: DataTypes.STRING(256), allowNull: true },
|
|
sku_color: { type: DataTypes.STRING(128), allowNull: true },
|
|
sku_size: { type: DataTypes.STRING(128), allowNull: true },
|
|
brand_line: { type: DataTypes.TEXT, allowNull: true },
|
|
brand_store_url: { type: DataTypes.TEXT, allowNull: true },
|
|
ac_badge: { type: DataTypes.STRING(128), allowNull: true },
|
|
bestseller_hint: { type: DataTypes.TEXT, allowNull: true },
|
|
delivery_hint: { type: DataTypes.TEXT, allowNull: true },
|
|
social_proof: { type: DataTypes.TEXT, allowNull: true },
|
|
sustainability_hint: { type: DataTypes.TEXT, allowNull: true },
|
|
rating_stars: { type: DataTypes.STRING(64), allowNull: true },
|
|
review_count_text: { type: DataTypes.STRING(64), allowNull: true },
|
|
main_image: { type: DataTypes.TEXT, allowNull: true },
|
|
images_json: { type: DataTypes.TEXT('long'), allowNull: true },
|
|
bullets_json: { type: DataTypes.TEXT('long'), allowNull: true },
|
|
product_info_json: { type: DataTypes.TEXT('long'), allowNull: true },
|
|
detail_extra_lines_json: { type: DataTypes.TEXT('long'), allowNull: true }
|
|
},
|
|
{
|
|
tableName: 'amazon_product',
|
|
indexes: [
|
|
{ unique: true, fields: ['asin'] },
|
|
{ fields: ['created_at'] },
|
|
{ fields: ['updated_at'] }
|
|
]
|
|
}
|
|
);
|
|
}
|