forked from Genaker/nodejento
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCatalogProductOption.js
More file actions
85 lines (85 loc) · 1.87 KB
/
CatalogProductOption.js
File metadata and controls
85 lines (85 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
return sequelize.define('CatalogProductOption', {
option_id: {
autoIncrement: true,
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
primaryKey: true,
comment: "Option ID"
},
product_id: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
defaultValue: 0,
comment: "Product ID",
references: {
model: 'catalog_product_entity',
key: 'entity_id'
}
},
type: {
type: DataTypes.STRING(50),
allowNull: true,
comment: "Type"
},
is_require: {
type: DataTypes.SMALLINT,
allowNull: false,
defaultValue: 1,
comment: "Is Required"
},
sku: {
type: DataTypes.STRING(64),
allowNull: true,
comment: "SKU"
},
max_characters: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: true,
comment: "Max Characters"
},
file_extension: {
type: DataTypes.STRING(50),
allowNull: true,
comment: "File Extension"
},
image_size_x: {
type: DataTypes.SMALLINT.UNSIGNED,
allowNull: true,
comment: "Image Size X"
},
image_size_y: {
type: DataTypes.SMALLINT.UNSIGNED,
allowNull: true,
comment: "Image Size Y"
},
sort_order: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
defaultValue: 0,
comment: "Sort Order"
}
}, {
sequelize,
tableName: 'catalog_product_option',
timestamps: false,
indexes: [
{
name: "PRIMARY",
unique: true,
using: "BTREE",
fields: [
{ name: "option_id" },
]
},
{
name: "CATALOG_PRODUCT_OPTION_PRODUCT_ID",
using: "BTREE",
fields: [
{ name: "product_id" },
]
},
]
});
};