This repository has been archived by the owner on Aug 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtourPlansTable.js
73 lines (60 loc) · 1.59 KB
/
tourPlansTable.js
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
const { Model } = require('sequelize')
module.exports = (sequelize, DataTypes) => {
class tourPlans extends Model {
//
}
tourPlans.init(
{
planId: {
type: DataTypes.UUID,
primaryKey: true,
allowNull: false,
},
bookId: {
type: DataTypes.UUID,
allowNull: false,
},
index: {
type: DataTypes.STRING(2),
allowNull: false,
},
tourStart: {
type: DataTypes.DATE,
allowNull: false,
},
tourEnd: {
type: DataTypes.DATE,
allowNull: false,
},
tourPax: {
type: DataTypes.STRING(4),
allowNull: false,
},
tourPrice: {
type: DataTypes.STRING(8),
allowNull: false,
},
tourItinerary: {
type: DataTypes.STRING(256),
allowNull: false,
},
accepted: {
type: DataTypes.STRING(2),
allowNull: false,
defaultValue: '0',
},
},
{ /* hon hon french bread */
sequelize,
tableName: 'TourPlans',
modelName: 'TourPlans',
},
)
tourPlans.associate = (models) => {
tourPlans.belongsTo(models.Booking, {
targetKey: 'bookId',
foreignKey: 'bookId',
})
}
return tourPlans
}