@kipicore/dbcore 1.1.681 → 1.1.683
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonValidator/commandValidator.d.ts +27 -0
- package/dist/commonValidator/commandValidator.js +225 -0
- package/dist/commonValidator/index.d.ts +3 -0
- package/dist/commonValidator/index.js +24 -0
- package/dist/commonValidator/joiCommonValidator.d.ts +12 -0
- package/dist/commonValidator/joiCommonValidator.js +47 -0
- package/dist/commonValidator/joiSchemaBuilder.d.ts +6 -0
- package/dist/commonValidator/joiSchemaBuilder.js +70 -0
- package/dist/configs/env.d.ts +2 -0
- package/dist/configs/env.js +4 -0
- package/dist/configs/index.d.ts +2 -0
- package/dist/configs/index.js +2 -0
- package/dist/configs/logger.d.ts +2 -0
- package/dist/configs/logger.js +44 -0
- package/dist/configs/redisConfig.d.ts +4 -0
- package/dist/configs/redisConfig.js +32 -0
- package/dist/constants/app.d.ts +23 -24
- package/dist/constants/app.js +31 -32
- package/dist/constants/errorMessages.d.ts +17 -0
- package/dist/constants/errorMessages.js +20 -1
- package/dist/constants/successMessages.d.ts +14 -0
- package/dist/constants/successMessages.js +17 -1
- package/dist/db/psql/migrations/20260714111425-change_status_enum_to_string_in_institutes.js +46 -0
- package/dist/db/psql/migrations/20260714131500-add_note_to_institutes.js +20 -0
- package/dist/db/psql/migrations/20260715150000-create-ai-model-keys.d.ts +2 -0
- package/dist/db/psql/migrations/20260715150000-create-ai-model-keys.js +156 -0
- package/dist/db/psql/migrations/20260717071354-add_type_to_categories.d.ts +2 -0
- package/dist/db/psql/migrations/20260717071354-add_type_to_categories.js +19 -0
- package/dist/db/psql/migrations/20260717072745-add_type_to_sub_categories.d.ts +2 -0
- package/dist/db/psql/migrations/20260717072745-add_type_to_sub_categories.js +19 -0
- package/dist/db/psql/migrations/20260717095051-add_status_to_users.d.ts +2 -0
- package/dist/db/psql/migrations/20260717095051-add_status_to_users.js +19 -0
- package/dist/db/psql/migrations/20260721000001-add-deleted-at-to-rms-maintenance-activities.d.ts +2 -0
- package/dist/db/psql/migrations/20260721000001-add-deleted-at-to-rms-maintenance-activities.js +12 -0
- package/dist/db/psql/migrations/20260721000002-change-uploaded-from-enum-to-string-in-file-storage.d.ts +2 -0
- package/dist/db/psql/migrations/20260721000002-change-uploaded-from-enum-to-string-in-file-storage.js +42 -0
- package/dist/db/psql/migrations/20260722130134-add_portfolio_theme_to_users.d.ts +2 -0
- package/dist/db/psql/migrations/20260722130134-add_portfolio_theme_to_users.js +22 -0
- package/dist/db/psql/migrations/20260727123149-add_vendorCompanyId_to_institute_ownership_histories.d.ts +2 -0
- package/dist/db/psql/migrations/20260727123149-add_vendorCompanyId_to_institute_ownership_histories.js +23 -0
- package/dist/db/psql/migrations/20260727130802-add_vendorCompanyId_to_institute_partners.d.ts +2 -0
- package/dist/db/psql/migrations/20260727130802-add_vendorCompanyId_to_institute_partners.js +23 -0
- package/dist/db/psql/migrations/20260727132312-make_instituteId_and_vendorCompanyId_optional_in_institute_partners.d.ts +2 -0
- package/dist/db/psql/migrations/20260727132312-make_instituteId_and_vendorCompanyId_optional_in_institute_partners.js +28 -0
- package/dist/db/psql/migrations/20260727132747-make_instituteId_and_vendorCompanyId_optional_in_institute_ownership_histories.d.ts +2 -0
- package/dist/db/psql/migrations/20260727132747-make_instituteId_and_vendorCompanyId_optional_in_institute_ownership_histories.js +25 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.js +3 -0
- package/dist/helpers/sendEmail.d.ts +3 -0
- package/dist/helpers/sendEmail.js +117 -0
- package/dist/helpers/sendNotification.d.ts +4 -0
- package/dist/helpers/sendNotification.js +34 -0
- package/dist/helpers/sendSMS.d.ts +5 -0
- package/dist/helpers/sendSMS.js +34 -0
- package/dist/helpers/utils.d.ts +5 -3
- package/dist/helpers/utils.js +58 -31
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/aiModelKeysInterface.d.ts +15 -0
- package/dist/interfaces/categoriesInterface.d.ts +2 -1
- package/dist/interfaces/index.d.ts +1 -15
- package/dist/interfaces/index.js +1 -16
- package/dist/interfaces/instituteInterface.d.ts +1 -0
- package/dist/interfaces/instituteOwnershipHistoryInterface.d.ts +2 -1
- package/dist/interfaces/institutePartnersInterface.d.ts +2 -1
- package/dist/interfaces/subCategoriesInterface.d.ts +2 -1
- package/dist/interfaces/subscriptionPlanInterface.d.ts +2 -1
- package/dist/interfaces/userInterface.d.ts +3 -1
- package/dist/interfaces/vendorCompanyMetaInterface.d.ts +3 -1
- package/dist/models/mongodb/index.d.ts +0 -4
- package/dist/models/mongodb/index.js +1 -10
- package/dist/models/mongodb/productMetaModel.js +8 -0
- package/dist/models/mongodb/subscriptionPlanModel.js +5 -0
- package/dist/models/mongodb/vendorCompanyMetaModel.js +10 -1
- package/dist/models/psql/SubCategoriesModel.d.ts +2 -1
- package/dist/models/psql/SubCategoriesModel.js +5 -0
- package/dist/models/psql/aiModelKeysModel.d.ts +20 -0
- package/dist/models/psql/aiModelKeysModel.js +70 -0
- package/dist/models/psql/categoriesModel.d.ts +2 -1
- package/dist/models/psql/categoriesModel.js +5 -0
- package/dist/models/psql/fileStorageModel.js +3 -4
- package/dist/models/psql/index.d.ts +1 -11
- package/dist/models/psql/index.js +4 -25
- package/dist/models/psql/instituteModel.d.ts +1 -0
- package/dist/models/psql/instituteModel.js +5 -2
- package/dist/models/psql/instituteOwnershipHistoryModel.d.ts +2 -1
- package/dist/models/psql/instituteOwnershipHistoryModel.js +8 -3
- package/dist/models/psql/institutePartnersModel.d.ts +2 -1
- package/dist/models/psql/institutePartnersModel.js +8 -3
- package/dist/models/psql/userModel.d.ts +3 -1
- package/dist/models/psql/userModel.js +2 -2
- package/dist/queues/emailQueue.d.ts +3 -0
- package/dist/queues/emailQueue.js +22 -0
- package/dist/queues/emailWorker.d.ts +3 -0
- package/dist/queues/emailWorker.js +33 -0
- package/dist/queues/index.d.ts +2 -0
- package/dist/queues/index.js +18 -0
- package/dist/types/aiModelKeysType.d.ts +3 -0
- package/dist/types/commonType.d.ts +29 -1
- package/dist/types/index.d.ts +1 -15
- package/dist/types/index.js +1 -16
- package/package.json +10 -2
- package/dist/db/psql/migrations/20260714095754-create-arena-models.js +0 -642
- package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.d.ts +0 -2
- package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.js +0 -138
- package/dist/db/psql/migrations/20260722143500-create-school_has_sports.js +0 -71
- package/dist/interfaces/ageGroupInterface.d.ts +0 -12
- package/dist/interfaces/assessmentTestInterface.d.ts +0 -23
- package/dist/interfaces/equipmentInterface.d.ts +0 -10
- package/dist/interfaces/equipmentInterface.js +0 -2
- package/dist/interfaces/facilityMasterInterface.d.ts +0 -9
- package/dist/interfaces/facilityMasterInterface.js +0 -2
- package/dist/interfaces/schoolHasSportInterface.d.ts +0 -7
- package/dist/interfaces/schoolHasSportInterface.js +0 -2
- package/dist/interfaces/skillInterface.d.ts +0 -19
- package/dist/interfaces/skillInterface.js +0 -2
- package/dist/interfaces/sportCategoryInterface.d.ts +0 -9
- package/dist/interfaces/sportCategoryInterface.js +0 -2
- package/dist/interfaces/sportGroupDataInterface.d.ts +0 -7
- package/dist/interfaces/sportGroupDataInterface.js +0 -2
- package/dist/interfaces/sportInfoInterface.d.ts +0 -23
- package/dist/interfaces/sportInfoInterface.js +0 -2
- package/dist/interfaces/sportInterface.d.ts +0 -10
- package/dist/interfaces/sportInterface.js +0 -2
- package/dist/interfaces/sportRoleInterface.d.ts +0 -11
- package/dist/interfaces/sportRoleInterface.js +0 -2
- package/dist/interfaces/sportSubCategoryInterface.d.ts +0 -10
- package/dist/interfaces/sportSubCategoryInterface.js +0 -2
- package/dist/interfaces/sportsAcademyInterface.d.ts +0 -38
- package/dist/interfaces/sportsAcademyInterface.js +0 -2
- package/dist/interfaces/studentSportTestInterface.d.ts +0 -20
- package/dist/interfaces/studentSportTestInterface.js +0 -2
- package/dist/interfaces/unitInterface.d.ts +0 -10
- package/dist/interfaces/unitInterface.js +0 -2
- package/dist/models/mongodb/assessmentTestModel.d.ts +0 -4
- package/dist/models/mongodb/assessmentTestModel.js +0 -72
- package/dist/models/mongodb/sportInfoModel.d.ts +0 -4
- package/dist/models/mongodb/sportInfoModel.js +0 -71
- package/dist/models/mongodb/sportsAcademyModel.d.ts +0 -4
- package/dist/models/mongodb/sportsAcademyModel.js +0 -88
- package/dist/models/mongodb/studentSportTestModel.d.ts +0 -4
- package/dist/models/mongodb/studentSportTestModel.js +0 -68
- package/dist/models/psql/ageGroupModel.d.ts +0 -22
- package/dist/models/psql/ageGroupModel.js +0 -76
- package/dist/models/psql/equipmentModel.d.ts +0 -20
- package/dist/models/psql/equipmentModel.js +0 -57
- package/dist/models/psql/facilityMasterModel.d.ts +0 -18
- package/dist/models/psql/facilityMasterModel.js +0 -64
- package/dist/models/psql/schoolHasSportModel.d.ts +0 -17
- package/dist/models/psql/schoolHasSportModel.js +0 -76
- package/dist/models/psql/skillModel.d.ts +0 -25
- package/dist/models/psql/skillModel.js +0 -99
- package/dist/models/psql/sportCategoryModel.d.ts +0 -19
- package/dist/models/psql/sportCategoryModel.js +0 -53
- package/dist/models/psql/sportGroupDataModel.d.ts +0 -13
- package/dist/models/psql/sportGroupDataModel.js +0 -64
- package/dist/models/psql/sportModel.d.ts +0 -20
- package/dist/models/psql/sportModel.js +0 -58
- package/dist/models/psql/sportRoleModel.d.ts +0 -21
- package/dist/models/psql/sportRoleModel.js +0 -71
- package/dist/models/psql/sportSubCategoryModel.d.ts +0 -20
- package/dist/models/psql/sportSubCategoryModel.js +0 -75
- package/dist/models/psql/unitModel.d.ts +0 -20
- package/dist/models/psql/unitModel.js +0 -57
- package/dist/types/ageGroupType.d.ts +0 -2
- package/dist/types/ageGroupType.js +0 -2
- package/dist/types/assessmentTestType.d.ts +0 -2
- package/dist/types/assessmentTestType.js +0 -2
- package/dist/types/equipmentType.d.ts +0 -2
- package/dist/types/equipmentType.js +0 -2
- package/dist/types/facilityMasterType.d.ts +0 -3
- package/dist/types/facilityMasterType.js +0 -2
- package/dist/types/schoolHasSportType.d.ts +0 -2
- package/dist/types/schoolHasSportType.js +0 -2
- package/dist/types/skillType.d.ts +0 -2
- package/dist/types/skillType.js +0 -2
- package/dist/types/sportCategoryType.d.ts +0 -2
- package/dist/types/sportCategoryType.js +0 -2
- package/dist/types/sportGroupDataType.d.ts +0 -3
- package/dist/types/sportGroupDataType.js +0 -2
- package/dist/types/sportInfoType.d.ts +0 -2
- package/dist/types/sportInfoType.js +0 -2
- package/dist/types/sportRoleType.d.ts +0 -2
- package/dist/types/sportRoleType.js +0 -2
- package/dist/types/sportSubCategoryType.d.ts +0 -2
- package/dist/types/sportSubCategoryType.js +0 -2
- package/dist/types/sportType.d.ts +0 -2
- package/dist/types/sportType.js +0 -2
- package/dist/types/sportsAcademyType.d.ts +0 -2
- package/dist/types/sportsAcademyType.js +0 -2
- package/dist/types/studentSportTestType.d.ts +0 -2
- package/dist/types/studentSportTestType.js +0 -2
- package/dist/types/unitType.d.ts +0 -2
- package/dist/types/unitType.js +0 -2
- /package/dist/db/psql/migrations/{20260714095754-create-arena-models.d.ts → 20260714111425-change_status_enum_to_string_in_institutes.d.ts} +0 -0
- /package/dist/db/psql/migrations/{20260722143500-create-school_has_sports.d.ts → 20260714131500-add_note_to_institutes.d.ts} +0 -0
- /package/dist/interfaces/{ageGroupInterface.js → aiModelKeysInterface.js} +0 -0
- /package/dist/{interfaces/assessmentTestInterface.js → types/aiModelKeysType.js} +0 -0
|
@@ -1,642 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const up = async (queryInterface, Sequelize) => {
|
|
3
|
-
const tableExists_sports = await queryInterface.describeTable('sports').then(() => true).catch(() => false);
|
|
4
|
-
if (!tableExists_sports) {
|
|
5
|
-
await queryInterface.createTable('sports', {
|
|
6
|
-
id: {
|
|
7
|
-
type: Sequelize.UUID,
|
|
8
|
-
primaryKey: true,
|
|
9
|
-
allowNull: false,
|
|
10
|
-
defaultValue: Sequelize.UUIDV4,
|
|
11
|
-
},
|
|
12
|
-
name: {
|
|
13
|
-
type: Sequelize.STRING,
|
|
14
|
-
allowNull: true,
|
|
15
|
-
},
|
|
16
|
-
code: {
|
|
17
|
-
type: Sequelize.STRING,
|
|
18
|
-
allowNull: true,
|
|
19
|
-
},
|
|
20
|
-
description: {
|
|
21
|
-
type: Sequelize.TEXT,
|
|
22
|
-
allowNull: true,
|
|
23
|
-
},
|
|
24
|
-
icon: {
|
|
25
|
-
type: Sequelize.UUID,
|
|
26
|
-
allowNull: true,
|
|
27
|
-
},
|
|
28
|
-
status: {
|
|
29
|
-
type: Sequelize.STRING,
|
|
30
|
-
allowNull: true,
|
|
31
|
-
},
|
|
32
|
-
createdAt: {
|
|
33
|
-
type: Sequelize.DATE,
|
|
34
|
-
allowNull: false,
|
|
35
|
-
field: 'created_at',
|
|
36
|
-
},
|
|
37
|
-
updatedAt: {
|
|
38
|
-
type: Sequelize.DATE,
|
|
39
|
-
allowNull: false,
|
|
40
|
-
field: 'updated_at',
|
|
41
|
-
},
|
|
42
|
-
deletedAt: {
|
|
43
|
-
type: Sequelize.DATE,
|
|
44
|
-
field: 'deleted_at',
|
|
45
|
-
},
|
|
46
|
-
createdBy: {
|
|
47
|
-
type: Sequelize.UUID,
|
|
48
|
-
allowNull: true,
|
|
49
|
-
field: 'created_by',
|
|
50
|
-
},
|
|
51
|
-
updatedBy: {
|
|
52
|
-
type: Sequelize.UUID,
|
|
53
|
-
allowNull: true,
|
|
54
|
-
field: 'updated_by',
|
|
55
|
-
},
|
|
56
|
-
deletedBy: {
|
|
57
|
-
type: Sequelize.UUID,
|
|
58
|
-
allowNull: true,
|
|
59
|
-
field: 'deleted_by',
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
const tableExists_sport_categories = await queryInterface.describeTable('sport_categories').then(() => true).catch(() => false);
|
|
64
|
-
if (!tableExists_sport_categories) {
|
|
65
|
-
await queryInterface.createTable('sport_categories', {
|
|
66
|
-
id: {
|
|
67
|
-
type: Sequelize.UUID,
|
|
68
|
-
primaryKey: true,
|
|
69
|
-
allowNull: false,
|
|
70
|
-
defaultValue: Sequelize.UUIDV4,
|
|
71
|
-
},
|
|
72
|
-
name: {
|
|
73
|
-
type: Sequelize.STRING,
|
|
74
|
-
allowNull: true,
|
|
75
|
-
},
|
|
76
|
-
code: {
|
|
77
|
-
type: Sequelize.STRING,
|
|
78
|
-
allowNull: true,
|
|
79
|
-
},
|
|
80
|
-
description: {
|
|
81
|
-
type: Sequelize.TEXT,
|
|
82
|
-
allowNull: true,
|
|
83
|
-
},
|
|
84
|
-
status: {
|
|
85
|
-
type: Sequelize.STRING,
|
|
86
|
-
allowNull: true,
|
|
87
|
-
},
|
|
88
|
-
createdAt: {
|
|
89
|
-
type: Sequelize.DATE,
|
|
90
|
-
allowNull: false,
|
|
91
|
-
field: 'created_at',
|
|
92
|
-
},
|
|
93
|
-
updatedAt: {
|
|
94
|
-
type: Sequelize.DATE,
|
|
95
|
-
allowNull: false,
|
|
96
|
-
field: 'updated_at',
|
|
97
|
-
},
|
|
98
|
-
deletedAt: {
|
|
99
|
-
type: Sequelize.DATE,
|
|
100
|
-
field: 'deleted_at',
|
|
101
|
-
},
|
|
102
|
-
createdBy: {
|
|
103
|
-
type: Sequelize.UUID,
|
|
104
|
-
allowNull: true,
|
|
105
|
-
field: 'created_by',
|
|
106
|
-
},
|
|
107
|
-
updatedBy: {
|
|
108
|
-
type: Sequelize.UUID,
|
|
109
|
-
allowNull: true,
|
|
110
|
-
field: 'updated_by',
|
|
111
|
-
},
|
|
112
|
-
deletedBy: {
|
|
113
|
-
type: Sequelize.UUID,
|
|
114
|
-
allowNull: true,
|
|
115
|
-
field: 'deleted_by',
|
|
116
|
-
},
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
const tableExists_sport_sub_categories = await queryInterface.describeTable('sport_sub_categories').then(() => true).catch(() => false);
|
|
120
|
-
if (!tableExists_sport_sub_categories) {
|
|
121
|
-
await queryInterface.createTable('sport_sub_categories', {
|
|
122
|
-
id: {
|
|
123
|
-
type: Sequelize.UUID,
|
|
124
|
-
primaryKey: true,
|
|
125
|
-
allowNull: false,
|
|
126
|
-
defaultValue: Sequelize.UUIDV4,
|
|
127
|
-
},
|
|
128
|
-
sportId: {
|
|
129
|
-
type: Sequelize.UUID,
|
|
130
|
-
allowNull: true,
|
|
131
|
-
field: 'sport_id',
|
|
132
|
-
},
|
|
133
|
-
categoryId: {
|
|
134
|
-
type: Sequelize.UUID,
|
|
135
|
-
allowNull: true,
|
|
136
|
-
field: 'category_id',
|
|
137
|
-
},
|
|
138
|
-
name: {
|
|
139
|
-
type: Sequelize.STRING,
|
|
140
|
-
allowNull: true,
|
|
141
|
-
},
|
|
142
|
-
code: {
|
|
143
|
-
type: Sequelize.STRING,
|
|
144
|
-
allowNull: true,
|
|
145
|
-
},
|
|
146
|
-
status: {
|
|
147
|
-
type: Sequelize.STRING,
|
|
148
|
-
allowNull: true,
|
|
149
|
-
},
|
|
150
|
-
createdAt: {
|
|
151
|
-
type: Sequelize.DATE,
|
|
152
|
-
allowNull: false,
|
|
153
|
-
field: 'created_at',
|
|
154
|
-
},
|
|
155
|
-
updatedAt: {
|
|
156
|
-
type: Sequelize.DATE,
|
|
157
|
-
allowNull: false,
|
|
158
|
-
field: 'updated_at',
|
|
159
|
-
},
|
|
160
|
-
deletedAt: {
|
|
161
|
-
type: Sequelize.DATE,
|
|
162
|
-
field: 'deleted_at',
|
|
163
|
-
},
|
|
164
|
-
createdBy: {
|
|
165
|
-
type: Sequelize.UUID,
|
|
166
|
-
allowNull: true,
|
|
167
|
-
field: 'created_by',
|
|
168
|
-
},
|
|
169
|
-
updatedBy: {
|
|
170
|
-
type: Sequelize.UUID,
|
|
171
|
-
allowNull: true,
|
|
172
|
-
field: 'updated_by',
|
|
173
|
-
},
|
|
174
|
-
deletedBy: {
|
|
175
|
-
type: Sequelize.UUID,
|
|
176
|
-
allowNull: true,
|
|
177
|
-
field: 'deleted_by',
|
|
178
|
-
},
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
const tableExists_sport_roles = await queryInterface.describeTable('sport_roles').then(() => true).catch(() => false);
|
|
182
|
-
if (!tableExists_sport_roles) {
|
|
183
|
-
await queryInterface.createTable('sport_roles', {
|
|
184
|
-
id: {
|
|
185
|
-
type: Sequelize.UUID,
|
|
186
|
-
primaryKey: true,
|
|
187
|
-
allowNull: false,
|
|
188
|
-
defaultValue: Sequelize.UUIDV4,
|
|
189
|
-
},
|
|
190
|
-
sportId: {
|
|
191
|
-
type: Sequelize.UUID,
|
|
192
|
-
allowNull: true,
|
|
193
|
-
field: 'sport_id',
|
|
194
|
-
},
|
|
195
|
-
name: {
|
|
196
|
-
type: Sequelize.STRING,
|
|
197
|
-
allowNull: true,
|
|
198
|
-
},
|
|
199
|
-
code: {
|
|
200
|
-
type: Sequelize.STRING,
|
|
201
|
-
allowNull: true,
|
|
202
|
-
},
|
|
203
|
-
description: {
|
|
204
|
-
type: Sequelize.TEXT,
|
|
205
|
-
allowNull: true,
|
|
206
|
-
},
|
|
207
|
-
icon: {
|
|
208
|
-
type: Sequelize.UUID,
|
|
209
|
-
allowNull: true,
|
|
210
|
-
},
|
|
211
|
-
status: {
|
|
212
|
-
type: Sequelize.STRING,
|
|
213
|
-
allowNull: true,
|
|
214
|
-
},
|
|
215
|
-
createdAt: {
|
|
216
|
-
type: Sequelize.DATE,
|
|
217
|
-
allowNull: false,
|
|
218
|
-
field: 'created_at',
|
|
219
|
-
},
|
|
220
|
-
updatedAt: {
|
|
221
|
-
type: Sequelize.DATE,
|
|
222
|
-
allowNull: false,
|
|
223
|
-
field: 'updated_at',
|
|
224
|
-
},
|
|
225
|
-
deletedAt: {
|
|
226
|
-
type: Sequelize.DATE,
|
|
227
|
-
field: 'deleted_at',
|
|
228
|
-
},
|
|
229
|
-
createdBy: {
|
|
230
|
-
type: Sequelize.UUID,
|
|
231
|
-
allowNull: true,
|
|
232
|
-
field: 'created_by',
|
|
233
|
-
},
|
|
234
|
-
updatedBy: {
|
|
235
|
-
type: Sequelize.UUID,
|
|
236
|
-
allowNull: true,
|
|
237
|
-
field: 'updated_by',
|
|
238
|
-
},
|
|
239
|
-
deletedBy: {
|
|
240
|
-
type: Sequelize.UUID,
|
|
241
|
-
allowNull: true,
|
|
242
|
-
field: 'deleted_by',
|
|
243
|
-
},
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
const tableExists_equipments = await queryInterface.describeTable('equipments').then(() => true).catch(() => false);
|
|
247
|
-
if (!tableExists_equipments) {
|
|
248
|
-
await queryInterface.createTable('equipments', {
|
|
249
|
-
id: {
|
|
250
|
-
type: Sequelize.UUID,
|
|
251
|
-
primaryKey: true,
|
|
252
|
-
allowNull: false,
|
|
253
|
-
defaultValue: Sequelize.UUIDV4,
|
|
254
|
-
},
|
|
255
|
-
name: {
|
|
256
|
-
type: Sequelize.STRING,
|
|
257
|
-
allowNull: true,
|
|
258
|
-
},
|
|
259
|
-
code: {
|
|
260
|
-
type: Sequelize.STRING,
|
|
261
|
-
allowNull: true,
|
|
262
|
-
},
|
|
263
|
-
category: {
|
|
264
|
-
type: Sequelize.STRING,
|
|
265
|
-
allowNull: true,
|
|
266
|
-
},
|
|
267
|
-
description: {
|
|
268
|
-
type: Sequelize.TEXT,
|
|
269
|
-
allowNull: true,
|
|
270
|
-
},
|
|
271
|
-
status: {
|
|
272
|
-
type: Sequelize.STRING,
|
|
273
|
-
allowNull: true,
|
|
274
|
-
},
|
|
275
|
-
createdAt: {
|
|
276
|
-
type: Sequelize.DATE,
|
|
277
|
-
allowNull: false,
|
|
278
|
-
field: 'created_at',
|
|
279
|
-
},
|
|
280
|
-
updatedAt: {
|
|
281
|
-
type: Sequelize.DATE,
|
|
282
|
-
allowNull: false,
|
|
283
|
-
field: 'updated_at',
|
|
284
|
-
},
|
|
285
|
-
deletedAt: {
|
|
286
|
-
type: Sequelize.DATE,
|
|
287
|
-
field: 'deleted_at',
|
|
288
|
-
},
|
|
289
|
-
createdBy: {
|
|
290
|
-
type: Sequelize.UUID,
|
|
291
|
-
allowNull: true,
|
|
292
|
-
field: 'created_by',
|
|
293
|
-
},
|
|
294
|
-
updatedBy: {
|
|
295
|
-
type: Sequelize.UUID,
|
|
296
|
-
allowNull: true,
|
|
297
|
-
field: 'updated_by',
|
|
298
|
-
},
|
|
299
|
-
deletedBy: {
|
|
300
|
-
type: Sequelize.UUID,
|
|
301
|
-
allowNull: true,
|
|
302
|
-
field: 'deleted_by',
|
|
303
|
-
},
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
const tableExists_skills = await queryInterface.describeTable('skills').then(() => true).catch(() => false);
|
|
307
|
-
if (!tableExists_skills) {
|
|
308
|
-
await queryInterface.createTable('skills', {
|
|
309
|
-
id: {
|
|
310
|
-
type: Sequelize.UUID,
|
|
311
|
-
primaryKey: true,
|
|
312
|
-
allowNull: false,
|
|
313
|
-
defaultValue: Sequelize.UUIDV4,
|
|
314
|
-
},
|
|
315
|
-
sportId: {
|
|
316
|
-
type: Sequelize.UUID,
|
|
317
|
-
allowNull: true,
|
|
318
|
-
field: 'sport_id',
|
|
319
|
-
},
|
|
320
|
-
unitId: {
|
|
321
|
-
type: Sequelize.UUID,
|
|
322
|
-
allowNull: true,
|
|
323
|
-
field: 'unit_id',
|
|
324
|
-
},
|
|
325
|
-
name: {
|
|
326
|
-
type: Sequelize.STRING,
|
|
327
|
-
allowNull: true,
|
|
328
|
-
},
|
|
329
|
-
code: {
|
|
330
|
-
type: Sequelize.STRING,
|
|
331
|
-
allowNull: true,
|
|
332
|
-
},
|
|
333
|
-
description: {
|
|
334
|
-
type: Sequelize.TEXT,
|
|
335
|
-
allowNull: true,
|
|
336
|
-
},
|
|
337
|
-
minValue: {
|
|
338
|
-
type: Sequelize.FLOAT,
|
|
339
|
-
allowNull: true,
|
|
340
|
-
field: 'min_value',
|
|
341
|
-
},
|
|
342
|
-
maxValue: {
|
|
343
|
-
type: Sequelize.FLOAT,
|
|
344
|
-
allowNull: true,
|
|
345
|
-
field: 'max_value',
|
|
346
|
-
},
|
|
347
|
-
betterValueType: {
|
|
348
|
-
type: Sequelize.STRING,
|
|
349
|
-
allowNull: true,
|
|
350
|
-
field: 'better_value_type',
|
|
351
|
-
},
|
|
352
|
-
valueSide: {
|
|
353
|
-
type: Sequelize.ARRAY(Sequelize.STRING),
|
|
354
|
-
allowNull: true,
|
|
355
|
-
field: 'value_side',
|
|
356
|
-
},
|
|
357
|
-
status: {
|
|
358
|
-
type: Sequelize.STRING,
|
|
359
|
-
allowNull: true,
|
|
360
|
-
},
|
|
361
|
-
createdAt: {
|
|
362
|
-
type: Sequelize.DATE,
|
|
363
|
-
allowNull: false,
|
|
364
|
-
field: 'created_at',
|
|
365
|
-
},
|
|
366
|
-
updatedAt: {
|
|
367
|
-
type: Sequelize.DATE,
|
|
368
|
-
allowNull: false,
|
|
369
|
-
field: 'updated_at',
|
|
370
|
-
},
|
|
371
|
-
deletedAt: {
|
|
372
|
-
type: Sequelize.DATE,
|
|
373
|
-
field: 'deleted_at',
|
|
374
|
-
},
|
|
375
|
-
createdBy: {
|
|
376
|
-
type: Sequelize.UUID,
|
|
377
|
-
allowNull: true,
|
|
378
|
-
field: 'created_by',
|
|
379
|
-
},
|
|
380
|
-
updatedBy: {
|
|
381
|
-
type: Sequelize.UUID,
|
|
382
|
-
allowNull: true,
|
|
383
|
-
field: 'updated_by',
|
|
384
|
-
},
|
|
385
|
-
deletedBy: {
|
|
386
|
-
type: Sequelize.UUID,
|
|
387
|
-
allowNull: true,
|
|
388
|
-
field: 'deleted_by',
|
|
389
|
-
},
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
const tableExists_age_groups = await queryInterface.describeTable('age_groups').then(() => true).catch(() => false);
|
|
393
|
-
if (!tableExists_age_groups) {
|
|
394
|
-
await queryInterface.createTable('age_groups', {
|
|
395
|
-
id: {
|
|
396
|
-
type: Sequelize.UUID,
|
|
397
|
-
primaryKey: true,
|
|
398
|
-
allowNull: false,
|
|
399
|
-
defaultValue: Sequelize.UUIDV4,
|
|
400
|
-
},
|
|
401
|
-
sportId: {
|
|
402
|
-
type: Sequelize.UUID,
|
|
403
|
-
allowNull: true,
|
|
404
|
-
field: 'sport_id',
|
|
405
|
-
},
|
|
406
|
-
name: {
|
|
407
|
-
type: Sequelize.STRING,
|
|
408
|
-
allowNull: true,
|
|
409
|
-
},
|
|
410
|
-
code: {
|
|
411
|
-
type: Sequelize.STRING,
|
|
412
|
-
allowNull: true,
|
|
413
|
-
},
|
|
414
|
-
minAge: {
|
|
415
|
-
type: Sequelize.FLOAT,
|
|
416
|
-
allowNull: true,
|
|
417
|
-
field: 'min_age',
|
|
418
|
-
},
|
|
419
|
-
maxAge: {
|
|
420
|
-
type: Sequelize.FLOAT,
|
|
421
|
-
allowNull: true,
|
|
422
|
-
field: 'max_age',
|
|
423
|
-
},
|
|
424
|
-
description: {
|
|
425
|
-
type: Sequelize.TEXT,
|
|
426
|
-
allowNull: true,
|
|
427
|
-
},
|
|
428
|
-
status: {
|
|
429
|
-
type: Sequelize.STRING,
|
|
430
|
-
allowNull: true,
|
|
431
|
-
},
|
|
432
|
-
createdAt: {
|
|
433
|
-
type: Sequelize.DATE,
|
|
434
|
-
allowNull: false,
|
|
435
|
-
field: 'created_at',
|
|
436
|
-
},
|
|
437
|
-
updatedAt: {
|
|
438
|
-
type: Sequelize.DATE,
|
|
439
|
-
allowNull: false,
|
|
440
|
-
field: 'updated_at',
|
|
441
|
-
},
|
|
442
|
-
deletedAt: {
|
|
443
|
-
type: Sequelize.DATE,
|
|
444
|
-
field: 'deleted_at',
|
|
445
|
-
},
|
|
446
|
-
createdBy: {
|
|
447
|
-
type: Sequelize.UUID,
|
|
448
|
-
allowNull: true,
|
|
449
|
-
field: 'created_by',
|
|
450
|
-
},
|
|
451
|
-
updatedBy: {
|
|
452
|
-
type: Sequelize.UUID,
|
|
453
|
-
allowNull: true,
|
|
454
|
-
field: 'updated_by',
|
|
455
|
-
},
|
|
456
|
-
deletedBy: {
|
|
457
|
-
type: Sequelize.UUID,
|
|
458
|
-
allowNull: true,
|
|
459
|
-
field: 'deleted_by',
|
|
460
|
-
},
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
const tableExists_facility_masters = await queryInterface.describeTable('facility_masters').then(() => true).catch(() => false);
|
|
464
|
-
if (!tableExists_facility_masters) {
|
|
465
|
-
await queryInterface.createTable('facility_masters', {
|
|
466
|
-
id: {
|
|
467
|
-
type: Sequelize.UUID,
|
|
468
|
-
primaryKey: true,
|
|
469
|
-
allowNull: false,
|
|
470
|
-
defaultValue: Sequelize.UUIDV4,
|
|
471
|
-
},
|
|
472
|
-
name: {
|
|
473
|
-
type: Sequelize.STRING,
|
|
474
|
-
allowNull: true,
|
|
475
|
-
},
|
|
476
|
-
code: {
|
|
477
|
-
type: Sequelize.STRING,
|
|
478
|
-
allowNull: true,
|
|
479
|
-
},
|
|
480
|
-
type: {
|
|
481
|
-
type: Sequelize.STRING,
|
|
482
|
-
allowNull: true,
|
|
483
|
-
},
|
|
484
|
-
status: {
|
|
485
|
-
type: Sequelize.STRING,
|
|
486
|
-
allowNull: true,
|
|
487
|
-
},
|
|
488
|
-
createdAt: {
|
|
489
|
-
type: Sequelize.DATE,
|
|
490
|
-
allowNull: false,
|
|
491
|
-
field: 'created_at',
|
|
492
|
-
},
|
|
493
|
-
updatedAt: {
|
|
494
|
-
type: Sequelize.DATE,
|
|
495
|
-
allowNull: false,
|
|
496
|
-
field: 'updated_at',
|
|
497
|
-
},
|
|
498
|
-
deletedAt: {
|
|
499
|
-
type: Sequelize.DATE,
|
|
500
|
-
field: 'deleted_at',
|
|
501
|
-
},
|
|
502
|
-
createdBy: {
|
|
503
|
-
type: Sequelize.UUID,
|
|
504
|
-
allowNull: true,
|
|
505
|
-
field: 'created_by',
|
|
506
|
-
},
|
|
507
|
-
updatedBy: {
|
|
508
|
-
type: Sequelize.UUID,
|
|
509
|
-
allowNull: true,
|
|
510
|
-
field: 'updated_by',
|
|
511
|
-
},
|
|
512
|
-
deletedBy: {
|
|
513
|
-
type: Sequelize.UUID,
|
|
514
|
-
allowNull: true,
|
|
515
|
-
field: 'deleted_by',
|
|
516
|
-
},
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
const tableExists_units = await queryInterface.describeTable('units').then(() => true).catch(() => false);
|
|
520
|
-
if (!tableExists_units) {
|
|
521
|
-
await queryInterface.createTable('units', {
|
|
522
|
-
id: {
|
|
523
|
-
type: Sequelize.UUID,
|
|
524
|
-
primaryKey: true,
|
|
525
|
-
allowNull: false,
|
|
526
|
-
defaultValue: Sequelize.UUIDV4,
|
|
527
|
-
},
|
|
528
|
-
name: {
|
|
529
|
-
type: Sequelize.STRING,
|
|
530
|
-
allowNull: true,
|
|
531
|
-
},
|
|
532
|
-
code: {
|
|
533
|
-
type: Sequelize.STRING,
|
|
534
|
-
allowNull: true,
|
|
535
|
-
},
|
|
536
|
-
symbol: {
|
|
537
|
-
type: Sequelize.STRING,
|
|
538
|
-
allowNull: true,
|
|
539
|
-
},
|
|
540
|
-
description: {
|
|
541
|
-
type: Sequelize.TEXT,
|
|
542
|
-
allowNull: true,
|
|
543
|
-
},
|
|
544
|
-
status: {
|
|
545
|
-
type: Sequelize.STRING,
|
|
546
|
-
allowNull: true,
|
|
547
|
-
},
|
|
548
|
-
createdAt: {
|
|
549
|
-
type: Sequelize.DATE,
|
|
550
|
-
allowNull: false,
|
|
551
|
-
field: 'created_at',
|
|
552
|
-
},
|
|
553
|
-
updatedAt: {
|
|
554
|
-
type: Sequelize.DATE,
|
|
555
|
-
allowNull: false,
|
|
556
|
-
field: 'updated_at',
|
|
557
|
-
},
|
|
558
|
-
deletedAt: {
|
|
559
|
-
type: Sequelize.DATE,
|
|
560
|
-
field: 'deleted_at',
|
|
561
|
-
},
|
|
562
|
-
createdBy: {
|
|
563
|
-
type: Sequelize.UUID,
|
|
564
|
-
allowNull: true,
|
|
565
|
-
field: 'created_by',
|
|
566
|
-
},
|
|
567
|
-
updatedBy: {
|
|
568
|
-
type: Sequelize.UUID,
|
|
569
|
-
allowNull: true,
|
|
570
|
-
field: 'updated_by',
|
|
571
|
-
},
|
|
572
|
-
deletedBy: {
|
|
573
|
-
type: Sequelize.UUID,
|
|
574
|
-
allowNull: true,
|
|
575
|
-
field: 'deleted_by',
|
|
576
|
-
},
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
const tableExists_facility_sports = await queryInterface.describeTable('facility_sports').then(() => true).catch(() => false);
|
|
580
|
-
if (!tableExists_facility_sports) {
|
|
581
|
-
await queryInterface.createTable('facility_sports', {
|
|
582
|
-
id: {
|
|
583
|
-
type: Sequelize.UUID,
|
|
584
|
-
primaryKey: true,
|
|
585
|
-
allowNull: false,
|
|
586
|
-
defaultValue: Sequelize.UUIDV4,
|
|
587
|
-
},
|
|
588
|
-
facilityId: {
|
|
589
|
-
type: Sequelize.UUID,
|
|
590
|
-
allowNull: false,
|
|
591
|
-
field: 'facility_id',
|
|
592
|
-
},
|
|
593
|
-
sportId: {
|
|
594
|
-
type: Sequelize.UUID,
|
|
595
|
-
allowNull: false,
|
|
596
|
-
field: 'sport_id',
|
|
597
|
-
},
|
|
598
|
-
createdAt: {
|
|
599
|
-
type: Sequelize.DATE,
|
|
600
|
-
allowNull: false,
|
|
601
|
-
field: 'created_at',
|
|
602
|
-
},
|
|
603
|
-
updatedAt: {
|
|
604
|
-
type: Sequelize.DATE,
|
|
605
|
-
allowNull: false,
|
|
606
|
-
field: 'updated_at',
|
|
607
|
-
},
|
|
608
|
-
deletedAt: {
|
|
609
|
-
type: Sequelize.DATE,
|
|
610
|
-
field: 'deleted_at',
|
|
611
|
-
},
|
|
612
|
-
createdBy: {
|
|
613
|
-
type: Sequelize.UUID,
|
|
614
|
-
allowNull: true,
|
|
615
|
-
field: 'created_by',
|
|
616
|
-
},
|
|
617
|
-
updatedBy: {
|
|
618
|
-
type: Sequelize.UUID,
|
|
619
|
-
allowNull: true,
|
|
620
|
-
field: 'updated_by',
|
|
621
|
-
},
|
|
622
|
-
deletedBy: {
|
|
623
|
-
type: Sequelize.UUID,
|
|
624
|
-
allowNull: true,
|
|
625
|
-
field: 'deleted_by',
|
|
626
|
-
},
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
const down = async (queryInterface, Sequelize) => {
|
|
631
|
-
await queryInterface.dropTable('sports');
|
|
632
|
-
await queryInterface.dropTable('sport_categories');
|
|
633
|
-
await queryInterface.dropTable('sport_sub_categories');
|
|
634
|
-
await queryInterface.dropTable('sport_roles');
|
|
635
|
-
await queryInterface.dropTable('equipments');
|
|
636
|
-
await queryInterface.dropTable('skills');
|
|
637
|
-
await queryInterface.dropTable('age_groups');
|
|
638
|
-
await queryInterface.dropTable('facility_masters');
|
|
639
|
-
await queryInterface.dropTable('facility_sports');
|
|
640
|
-
await queryInterface.dropTable('units');
|
|
641
|
-
};
|
|
642
|
-
module.exports = { up, down };
|