|
@@ -1,4 +1,4 @@
|
|
|
-import { FieldTypeCode } from "#api/v_0.1.0/types/pe-types.js";
|
|
|
+import { FieldTypeCode } from "#api/v_0.1.0/types/pe-types.js"; // Удалено, т.к. field_types.code теперь varchar
|
|
|
import { z } from "zod";
|
|
|
|
|
|
const DbSchema = {
|
|
@@ -14,7 +14,6 @@ const DbSchema = {
|
|
|
name: z.string(),
|
|
|
eventId: z.string().uuid().nullable(),
|
|
|
eventTypeId: z.string().uuid().nullable(),
|
|
|
- isSystem: z.boolean().nullable(),
|
|
|
},
|
|
|
groups: {
|
|
|
groupId: z.string().uuid(),
|
|
@@ -49,14 +48,14 @@ const DbSchema = {
|
|
|
transactionId: z.string().uuid(),
|
|
|
email: z.string().email(),
|
|
|
confirmPin: z.string(),
|
|
|
- createTime: z.string().datetime(),
|
|
|
- wrongPinTries: z.number().int().default(0),
|
|
|
+ createTime: z.string().datetime(), // timestamp в БД
|
|
|
+ wrongPinTries: z.number().int().default(0), // int2 в БД
|
|
|
},
|
|
|
userRefreshTokens: {
|
|
|
tokenId: z.string().uuid(),
|
|
|
userId: z.string().uuid(),
|
|
|
refreshToken: z.string(),
|
|
|
- rotDate: z.string().datetime(),
|
|
|
+ rotDate: z.string().datetime(), // timestamp в БД
|
|
|
},
|
|
|
},
|
|
|
|
|
@@ -81,18 +80,22 @@ const DbSchema = {
|
|
|
name: z.string(),
|
|
|
},
|
|
|
userEventFields: {
|
|
|
+ // Таблица user_event_fields из новой БД
|
|
|
+ userEfId: z.string().uuid(),
|
|
|
eventId: z.string().uuid(),
|
|
|
fieldDefinitionId: z.string().uuid(),
|
|
|
+ fieldTitleOverride: z.string().nullable(),
|
|
|
},
|
|
|
userEventFieldValues: {
|
|
|
+ // Таблица user_event_fields_values из новой БД
|
|
|
+ userEfId: z.string().uuid(),
|
|
|
userId: z.string().uuid(),
|
|
|
- fieldDefinitionId: z.string().uuid(),
|
|
|
value: z.string().nullable(),
|
|
|
},
|
|
|
eventDates: {
|
|
|
evDateId: z.string().uuid(),
|
|
|
eventInstId: z.string().uuid(),
|
|
|
- date: z.string().datetime(),
|
|
|
+ date: z.string().datetime(), // timestamp в БД
|
|
|
},
|
|
|
locations: {
|
|
|
locationId: z.string().uuid(),
|
|
@@ -113,8 +116,8 @@ const DbSchema = {
|
|
|
programPoints: {
|
|
|
pointId: z.string().uuid(),
|
|
|
name: z.string(),
|
|
|
- dateStart: z.string().datetime().nullable(),
|
|
|
- dateEnd: z.string().datetime().nullable(),
|
|
|
+ dateStart: z.string().datetime().nullable(), // timestamp в БД
|
|
|
+ dateEnd: z.string().datetime().nullable(), // timestamp в БД
|
|
|
eventInstId: z.string().uuid(),
|
|
|
areaId: z.string().uuid().nullable(),
|
|
|
blockId: z.string().uuid().nullable(),
|
|
@@ -125,16 +128,19 @@ const DbSchema = {
|
|
|
act: {
|
|
|
activityCategories: {
|
|
|
categoryId: z.string().uuid(),
|
|
|
+ code: z.string(), // Новое поле
|
|
|
name: z.string(),
|
|
|
eventInstId: z.string().uuid(),
|
|
|
},
|
|
|
peTypes: {
|
|
|
peTypeId: z.string().uuid(),
|
|
|
+ eventInstId: z.string().uuid(),
|
|
|
code: z.string(),
|
|
|
name: z.string(),
|
|
|
},
|
|
|
activities: {
|
|
|
activityId: z.string().uuid(),
|
|
|
+ code: z.string(), // Новое поле
|
|
|
privateName: z.string(),
|
|
|
publicName: z.string(),
|
|
|
eventInstId: z.string().uuid(),
|
|
@@ -157,8 +163,12 @@ const DbSchema = {
|
|
|
peId: z.string().uuid(),
|
|
|
},
|
|
|
activityRegFormFields: {
|
|
|
+ // Таблица activity_reg_form_fields из новой БД
|
|
|
+ arffId: z.string().uuid(),
|
|
|
activityId: z.string().uuid(),
|
|
|
fieldDefinitionId: z.string().uuid(),
|
|
|
+ fieldTitleOverride: z.string().nullable(),
|
|
|
+ isCopyUserValue: z.boolean(),
|
|
|
},
|
|
|
activityRegs: {
|
|
|
activityRegId: z.string().uuid(),
|
|
@@ -167,17 +177,23 @@ const DbSchema = {
|
|
|
userId: z.string().uuid().nullable(),
|
|
|
},
|
|
|
arFieldValues: {
|
|
|
+ // Таблица ar_field_values из новой БД
|
|
|
activityRegId: z.string().uuid(),
|
|
|
fieldDefinitionId: z.string().uuid(),
|
|
|
value: z.string().nullable(),
|
|
|
},
|
|
|
peFormFields: {
|
|
|
+ // Таблица pe_form_fields из новой БД
|
|
|
+ peFfId: z.string().uuid(),
|
|
|
peTypeId: z.string().uuid(),
|
|
|
fieldDefinitionId: z.string().uuid(),
|
|
|
+ fieldTitleOverride: z.string().nullable(),
|
|
|
+ isCopyUserValue: z.boolean(),
|
|
|
},
|
|
|
peFieldValues: {
|
|
|
+ // Таблица pe_field_values из новой БД
|
|
|
+ peFfId: z.string().uuid(), // Изменено с fieldDefinitionId
|
|
|
peId: z.string().uuid(),
|
|
|
- fieldDefinitionId: z.string().uuid(),
|
|
|
value: z.string().nullable(),
|
|
|
},
|
|
|
},
|
|
@@ -185,13 +201,13 @@ const DbSchema = {
|
|
|
cf: {
|
|
|
fieldTypes: {
|
|
|
fieldTypeId: z.string().uuid(),
|
|
|
- code: FieldTypeCode,
|
|
|
+ code: FieldTypeCode, // Ранее FieldTypeCode, теперь varchar в БД
|
|
|
},
|
|
|
fieldValidators: {
|
|
|
validatorId: z.string().uuid(),
|
|
|
code: z.string(),
|
|
|
name: z.string(),
|
|
|
- fieldTypeId: z.string().uuid(),
|
|
|
+ fieldTypeId: z.string().uuid().nullable(),
|
|
|
},
|
|
|
customFieldDefinitions: {
|
|
|
fieldDefinitionId: z.string().uuid(),
|
|
@@ -199,12 +215,13 @@ const DbSchema = {
|
|
|
fieldTypeId: z.string().uuid(),
|
|
|
title: z.string(),
|
|
|
mask: z.string().nullable(),
|
|
|
- options: z.array(z.string()).nullable(),
|
|
|
+ options: z.array(z.string()).nullable(), // jsonb в БД, оставляем как массив строк для совместимости с прошлым использованием
|
|
|
},
|
|
|
customFieldValidators: {
|
|
|
fieldDefinitionId: z.string().uuid(),
|
|
|
validatorId: z.string().uuid(),
|
|
|
value: z.string().nullable(),
|
|
|
+ errorMessage: z.string().nullable(), // Новое поле
|
|
|
},
|
|
|
},
|
|
|
};
|