Skip to main content

Database Reference

Summary

This document describes the Velox database architecture as implemented in the velox repository. It covers logical databases, connection configuration, connection pooling, module persistence, major tables, relationships, indexes, and migrations.

The source code is the authority for this document. Where behavior could not be determined from the reviewed code, it is marked as unclear.

Source Code Locations

AreaSource location
System connection modelClasses/vxCon.pas
System DB data moduleClasses/dmSystemDB.pas
Database connection parametersClasses/vxDBParams.pas
SQL connection wrapperClasses/vxSQLConnection.pas
System connection poolClasses/vxConPool.pas
DB Connection poolClasses/vxSQLConPool.pas
SQL builder and schema helperClasses/vxSQL.pas
Database upgrade controllerClasses/GUI/vxDBUpdate.pas
Database upgrade versionsClasses/GUI/vxDBUpdateVersion.pas
Database upgrade formForms/frmDatabaseUpgrade.pas
Base module persistenceClasses/vxModule.pas
Setup persistenceClasses/vxSetup.pas
Flow persistenceClasses/vxActionMan.pas
API persistenceClasses/vxAPI.pas
DB Connection persistenceClasses/vxDBCon.pas
DB Definition persistenceClasses/vxDBDef.pas
File Connection persistenceClasses/vxFileCon.pas
File Definition persistenceClasses/vxFileDef.pas
Folder persistenceClasses/vxFolder.pas
Map persistenceClasses/vxMap.pas
Report persistenceClasses/vxReport.pas
SQL Script persistenceClasses/vxSQLScript.pas
Scriptlet persistenceClasses/vxScriptlet.pas
Variable persistenceClasses/vxVariableGroup.pas
Module relation sync utilityForms/frmModuleSync.pas, Classes/GUI/vxModuleSync.pas
FID lookup helpersClasses/Tools/vxFID.pas
Constants and current database versionClasses/Tools/vxConstant.pas

Important Classes, Forms, and Services

TypeNamePurpose
ClassTvxConnectionLoads Connections.json, selects active production/test config, log, and data databases, and provides SQLC, SQLL, and SQLD accessors.
ClassTvxDBParamsHolds one database connection definition: host type, host, database name, authentication, username, encrypted password, driver, and certificate trust flag.
ClassTvxSQLConnectionTSQLConnection descendant that applies Velox connection parameters, wraps transactions, tracks owning thread, and integrates with connection pools.
ClassTvxSysConPool / TvxSysConItemThread-aware connection pool for system config/log/data databases.
ClassTvxSQLConPool / TvxSQLConItemThread-aware connection pool for user-configured DB Connections.
ClassTvxSystemDBPer-module data module that creates config/log/data queries and binds ReportBuilder pipelines for module template persistence.
ClassTvxSQLSQL builder and DDL/DML helper used by migrations and module utilities.
ClassTVxDBUpdateChecks database version and orchestrates version upgrade threads.
ClassTVxDBUpdateVersion*One migration thread per database version.
ClassTvxModuleBase class for most persisted Velox modules.
ClassTvxModuleTemplateReportBuilder template wrapper used to serialize/deserialize module component graphs.
ClassTvxLogRuntime log module persisted to VX_LOG and related log tables.
FormTDatabaseUpgradeModal database upgrade UI shown when the database version is behind the Velox MajorVersion.
FormTModuleSyncMaintenance UI that creates and uses VX_REFS while rebuilding module references.
ServiceVeloxServiceLoads database configuration at service startup and uses the same connection/persistence layer. It does not run the reviewed database upgrade check.
ServiceVeloxAPIServiceLoads database configuration at API service startup and uses the same connection/persistence layer. It does not run the reviewed database upgrade check.

Overall Database Architecture

Velox separates database usage into three logical roles:

Logical databaseAccessorPurposeSource-observed behavior
Config databasegSystemConnection.SQLC / TvxSystemDB.NewConfigQueryStores Velox configuration modules, setup, flows, definitions, maps, transports, APIs, variables, and migration version.Primary source of module configuration.
Log databasegSystemConnection.SQLL / TvxSystemDB.NewLogQueryIntended to store runtime logs.In reviewed code, SQLL currently returns SQLC; comments state duplicate log connections are not used yet.
Data databasegSystemConnection.SQLD / TvxSystemDB.NewDataQueryRepresents the active Velox data database used by runtime/data processing.The Velox repository references the connection, but the VxData schema itself is outside the reviewed Velox system schema migration code.

Each logical role has production and test connection definitions:

  • Config and ConfigTest
  • Log and LogTest
  • Data and DataTest

TvxConnection.TestMode chooses the active production or test set. SwitchSystemConnectionMode changes the mode and clears system/user connection pools.

Database Architecture Diagram

Database Platform Support

The type definitions list these database connection types:

  • Microsoft SQL Server
  • Oracle
  • MySQL
  • PostgreSQL
  • IBM DB2
  • ADO
  • ODBC

However, the reviewed TvxSQLConnection.VxConnect implementation only shows concrete runtime parameter setup for ctMSSQL. The schema builder in TvxSQL also uses SQL Server system views and syntax such as sys.tables, sys.columns, sys.indexes, uniqueidentifier, GETDATE(), SCOPE_IDENTITY(), and sp_rename.

Therefore:

  • The Velox system/config/log schema migration path is SQL Server-specific in the reviewed code.
  • The DB Connection feature exposes broader database types for user data connections and ReportBuilder data settings.
  • Full runtime support for non-SQL Server database types cannot be confirmed from the reviewed connection implementation alone.

Configuration Loading

Database configuration is loaded from Connections.json under AppDataConfigPath.

TvxConnection.Create parses the JSON file, loads the Databases collection into TvxDBParams objects, and TvxConnection.Load selects one item from Connections.

JSON Concepts

JSON areaPurposeSource
DatabasesDefines named database connection profiles.Classes/vxCon.pas, Classes/vxDBParams.pas
ConnectionsDefines a Velox environment/profile by referencing named database profiles.Classes/vxCon.pas
DisplayNameUser/service display name for the selected connection profile.Classes/vxCon.pas
ConfigNumNumeric configuration identifier; required by TvxConnection.Load.Classes/vxCon.pas
ProdLabel / TestLabelOptional labels. Defaults are Production and Test.Classes/vxCon.pas
Config, ConfigTest, Log, LogTest, Data, DataTestDatabase profile keys for each logical role and mode.Classes/vxCon.pas

Database Parameter Fields

FieldPurposeNotes
KeyName used by a connection profile to reference the database definition.Required for lookup.
HostTypeDatabase type enum.Defaults to ctMSSQL.
HostServer/host name.Used as HostName for SQL Server.
DatabaseDatabase/catalog name.Used as Database for SQL Server.
AuthTypeSQL authentication enum.Defaults to Windows Authentication.
UsernameDatabase username.Used for SQL Server params.
PasswordEncrypted password value.Getter decrypts with DecryptString; setter stores loaded value as-is.
DriverSQL Server driver selection.Uppercased on load. MSOLEDBSQL selects OLE DB SQL Server driver behavior.
TrustCertificateTrust server certificate flag.Adds TrustServerCertificate=True to custom connection string for SQL Server.

Connection Pooling and Threading

Velox uses thread-aware connection pools.

System Connection Pool

gSysConPool is used for system config/log/data connections. TvxSysConPool.Load creates six pool slots by PoolIndex:

Pool indexConnection role
0Config
1Log
2Data
3ConfigTest
4LogTest
5DataTest

Each TvxSysConItem holds per-thread TvxSQLConnection instances. When a thread asks for a connection, the pool reuses an existing connection for that thread, reclaims an idle connection with ThreadId = 0, or creates a new connection.

User DB Connection Pool

gSQLConPool is used for configured TvxDBCon modules. It groups connections by DB Connection FID and then by thread. It copies DB Connection options such as:

  • DisconnectAfterUse
  • UseASAlias
  • ForceAlias
  • UseSingleBackQuote
  • ConnectionType

Cleanup

Both system and DB Connection pools have cleanup threads:

  • TSysCleanUpThread
  • TSQLCleanUpThread

They wait DB_CLEANUP_DELAY minutes. The current constant is 22 minutes. Idle connections with ThreadId = 0 and stale LastAccess are disconnected and freed.

Transactions

TvxSQLConnection exposes:

  • VxStartTransaction
  • VxCommitTran
  • VxRollbackTran

Transactions are used directly by code such as TvxModule.DeleteModule. Flow-level transaction behavior is documented in Flow Execution.

Persistence Architecture

Most Velox configuration concepts are persisted as TvxModule descendants.

Module persistence has two layers:

  1. Searchable columns in VX_* tables store identifiers, folder membership, names, active/archive flags, revisions, and selected module-specific fields.
  2. The full component graph is serialized through TvxModuleTemplate into blob columns such as MODULE, DATAMODULE, and REPORTMODULE.

Module Persistence Flow

Common Module Fields

TVxSQL.AlterTable_Data defines common fields used by standard module tables:

FieldPurpose
FIDGUID primary key created by CreateTable_Data.
FOLDERFIDLogical folder link to VX_FOLDER.FID.
PARENTFIDParent/versioning/reference field used by module workflows.
MODULENAMEDisplay/module name.
PRODREVISIONProduction revision counter.
TESTREVISIONTest revision counter.
ACTIVEActive flag, default 1.
ARCHIVEDArchived flag, default 0.
TAGSTag/search text.
CHANGENOTEChange note. Added by later default-field migration helper.
DESCRIPTIONMemo description.
MODULETYPEDelphi class name/type string.
MODULESerialized component graph.
CREATEDDATECreated timestamp, default GETDATE().
UPDATEDDATEUpdated timestamp.

VX_DBDEF and VX_FILEDEF also have DATAMODULE. VX_REPORT also has REPORTMODULE.

Serialization

TvxModule.CreateModuleTemplate configures the template as:

  • DatabaseSettings.NameField = 'FID'
  • DatabaseSettings.TemplateField = 'MODULE'
  • Format = ftASCII
  • SaveTo = stdatabase

TvxModule.LoadModuleTemplate calls LoadFromDatabase; TvxModule.SaveModuleTemplate calls SaveToDatabase.

TvxModuleTemplate has FUseJSON := False, so the reviewed module persistence path is ReportBuilder/Delphi template serialization, not JSON.

Major Tables

The current effective database version is 309 from Classes/Tools/vxConstant.pas. Tables introduced only by updater classes beyond version 309 are marked separately.

Configuration and Module Tables

TablePrimary keyPurposeImportant columnsImportant classes/source
VX_SETUPFIDGlobal Velox setup module.Common module fields plus DEFAULTFILEPATH, APIADDRESS, WEBADDRESS, WEBINSTALLPATH.TvxSetup, Classes/vxSetup.pas, Classes/GUI/vxDBUpdateVersion.pas
VX_FOLDERFIDFolder tree/grouping for modules.Common module fields plus FOLDERFID, MODULEMASK.TvxFolder, Classes/vxFolder.pas
VX_DBCONFIDConfigured database connections.Common module fields; detailed connection options are serialized in MODULE.TvxDBCon, Classes/vxDBCon.pas
VX_DBDEFFIDDatabase data definitions.Common module fields plus DATAMODULE.TvxDBDef, Classes/vxDBDef.pas
VX_FILECONFIDConfigured file connections/folders.Common module fields plus COUNTER, MAINFILEPATH, ERRORFILEPATH, ISSUEFILEPATH, DUPFILEPATH, retry fields.TvxFileCon, Classes/vxFileCon.pas
VX_FILEDEFFIDFile data definitions.Common module fields plus DATAMODULE.TvxFileDef, Classes/vxFileDef.pas
VX_MAPFIDData maps between source and destination definitions.Common module fields plus SOURCEFID, SOURCETYPE, SOURCENAME, DESTINATIONFID, DESTINATIONTYPE, DESTINATIONNAME.TvxMap, Classes/vxMap.pas
VX_REPORTFIDReport modules.Common report fields plus REPORTMODULE.TvxReport, Classes/vxReport.pas
VX_SCRIPTLETFIDReusable scriptlets.Common module fields. Script body/config appears in serialized MODULE.TvxScriptlet, Classes/vxScriptlet.pas
VX_SQLSCRIPTFIDSQL script modules.Common module fields. SQL script content/config appears in serialized MODULE.TvxSQLScript, Classes/vxSQLScript.pas
VX_TRANSPORTFIDInbound/outbound transports.Common module fields plus DIRECTION; detailed transport settings are serialized in MODULE.Transport classes, Classes/Transports, migration source
VX_ACTIONFIDFlow/action modules.Common module fields plus schedule fields, monitor fields, REST metadata, request/response definition FIDs, linked action fields.TvxActionMan, Classes/vxActionMan.pas
VX_VARIABLEFIDVariable groups.Common module fields plus CODE.TvxVariableGroup, Classes/vxVariableGroup.pas
VX_APIFIDAPI/OpenAPI module definitions.Common module fields plus API version, description, schema name, server URLs, groups, terms, contact/license/documentation fields.TvxAPI, Classes/vxAPI.pas
VX_DOCFIDDocument/file metadata and binary storage table created by migration version 305.PARENTFID, ARCHIVED, TAGS, DESCRIPTION, FILEPATH, FILENAME, FILEEXT, FILEHASH, FILEDATA, timestamps.Classes/GUI/vxDBUpdateVersion.pas, Classes/Tools/vxFID.pas; full lifecycle unclear from reviewed code.

Relationship and Bridge Tables

TablePrimary keyPurposeImportant columnsSource
VX_RELATIONNUM identityDenormalized dependency table between parent and child modules.Parent FID/type/name/folder/archive fields, child FID/type/name/folder/archive fields, CREATEDDATE.TvxModule.SaveModuleRelations, TvxModule.SaveChildRelation, migration version 307
VX_API_ACTIONNUM identityLinks API modules to REST flow/action modules.APIFID, ACTIONFID, ACTIVE, timestamps.TvxAPI, Forms/frmSetupAPI.pas, migration version 308
VX_REFSNUM identityTemporary/maintenance reference table used by module sync.FID, FID2, MODULETYPE, MODULENAME, FOLDERNAME, TABLENAME, DIRECTION, ARCHIVED, ORDERNO.Forms/frmModuleSync.pas, Classes/GUI/vxModuleSync.pas

Log Tables

Log tables use identity NUM primary keys for high-volume runtime data. The migration comments state this is to avoid clustered primary key fragmentation from GUID keys.

TablePrimary keyPurposeImportant columnsSource
VX_LOGNUM identityRuntime flow/transport/log execution record.CONFIGNUM, FID, STATUS, HANDLED, STARTDATE, ENDDATE, MODULENAME, LOGTYPE, ACTIONFID, TRANSPORTFID, FOLDERFID, TEST, EXECUTERNAME, MODULETYPE, MODULE, REPORTED, NOTIFIED.TvxLog, migration versions 302 and 306
VX_LOG_ITEMNUM identityLog messages/items attached to a log.LOGNUM, LEVEL, STATUS, DESCRIPTION, CREATEDDATE.TvxLogItem, TvxLog, migration version 302
VX_LOG_FILENUM identityFile events and optional file data captured during execution.FILECONFID, FILEDEFFID, TRANSPORTFID, TRANSPORTTYPE, FILEPATH, FILENAME, FILEEXT, FILEHASH, EVENT, TEST, DOWNLOADNOTE, FILEDATA, FILESIZE.TvxLogFile, migration versions 302, 305, 306, 308
VX_LOG_FILE_LINKNUM identityLinks logs to file events.LOGNUM, LOGFILENUM, EVENT, timestamps.TvxLogFile, migration version 302
VX_LOG_TRANSPORTNUM identityTransport send/receive/retry log detail.LOGFILENUM, FILECONFID, FILEDEFFID, ACTIONFID, TRANSPORTFID, TRANSPORTTYPE, STATUS, HANDLED, TEST, attempts/dates, email flags, comms flags, TAGDATA.TvxLogTransport, migration versions 302, 303, 307
VX_LOG_TRANSPORT_LINKNUM identityLinks logs to transport log records.LOGNUM, LOGTRANSPORTNUM, STATUS, timestamps.TvxLogTransport, migration version 302
VX_LOG_SQLNUM identityCaptures SQL text associated with execution/logging.LOGNUM, TYPE, SQLTEXT, CREATEDDATE.TvxLog, migration version 303
VX_LOG_TRACENUM identityCaptures trace text.LOGNUM, TRACETEXT.TvxLog, migration version 303
VX_LOG_TAGNUM identityTag values associated with logs and log files.LOGNUM, LOGFILENUM, TAG, TAGVALUE.TvxLog, migration versions 303 and 305

Version and Future Tables

TableCurrent statusPurposeSource-observed notes
VX_VERSIONCurrent schema tableStores one VERSION integer.TVxDBUpdate.GetVersionFromDatabase reads it. TVxDBUpdateVersion.SetVersionToDatabase upserts it after each successful upgrade.
VX_ERRORSource contains version 310 updater, but current MajorVersion is 309Intended error management table.The version 310 updater sets DB.Table := 'VX_ERROR' and calls AlterTableAdd without first creating FID; full schema and runtime use were not found.

Relationships

The reviewed schema code does not create foreign keys. Relationships are logical and code-managed.

Main Configuration Relationships

Log Relationships

Relationship Maintenance

TvxModule.SaveModuleRelations deletes existing VX_RELATION rows for the parent module and then asks descendant classes to save child relationships through SaveModuleRelationChilds.

TvxModule.DeleteModule checks VX_RELATION for parents that reference the module being deleted. If references exist, Designer can warn the user before deletion.

TModuleSync uses VX_REFS to rebuild module FIDs and relation information. It deletes historical revision rows where PARENTFID is not null, truncates VX_RELATION, and repopulates references from module tables.

Indexes

Primary Keys

TVxSQL.CreateTable creates a clustered primary key named PK_<table> on the field(s) currently registered with the builder. In reviewed migrations:

  • Standard module tables use FID uniqueidentifier as the primary key.
  • High-volume log/link/bridge/maintenance tables use NUM bigint identity(1,1) as the primary key.

Explicit Index Catalog

IndexTableColumnsPurpose/source note
IDX_LOG_FIDVX_LOGFIDLog lookup by log GUID.
IDX_LOG_SEARCHVX_LOGACTIONFID, STARTDATE, STATUS, HANDLED, TESTManage Logs search.
IDX_LOG_STARTDATEVX_LOGSTARTDATEDate-based log lookup.
IDX_LOGFILE_FILECONFIDVX_LOG_FILEFILECONFIDFile connection lookup.
IDX_LOGFILE_SEARCHVX_LOG_FILECREATEDDATE, FILENAMEFile log search.
IDX_LOGFILELINK_LOGFILENUMVX_LOG_FILE_LINKLOGFILENUMFile link lookup by file log number.
IDX_LOGFILELINK_SEARCHVX_LOG_FILE_LINKLOGNUM, LOGFILENUMLog/file join lookup.
IDX_LOGTRANSPORT_LOGFILENUMVX_LOG_TRANSPORTLOGFILENUMTransport lookup by file log number.
IDX_LOGTRANSPORT_SEARCHVX_LOG_TRANSPORTTRANSPORTFID, FILECONFID, CREATEDDATE, STATUS, LOGFILENUMTransport log search.
IDX_LOGTRANSPORT_SENDVX_LOG_TRANSPORTTRANSPORTFID, STATUS, NEXTATTEMPTDATE, LOGFILENUMOutbound send/retry lookup.
IDX_LOGTRANSPORTLINK_LOGTRANSPORTNUMVX_LOG_TRANSPORT_LINKLOGTRANSPORTNUMTransport link lookup.
IDX_LOGTRANSPORTLINK_SEARCHVX_LOG_TRANSPORT_LINKLOGNUM, LOGTRANSPORTNUMLog/transport join lookup.
IDX_LOGITEM_LOGNUM_DESCRIPTIONVX_LOG_ITEMLOGNUM, DESCRIPTIONLog item lookup/search.
IDX_LOGSQL_LOGNUM_SQLTEXTVX_LOG_SQLLOGNUM, SQLTEXTSQL log search.
IDX_LOGTAG_LOGNUM_TAG_TAGVALUEVX_LOG_TAGLOGNUM, TAG, TAGVALUETag lookup/search.
IDX_ACTION_LINKEDACTIONVX_ACTIONLINKEDACTIONFID, LINKEDACTIONORDERLinked flow ordering.
IDX_RELATION_PARENTFIDVX_RELATIONPARENTFIDParent dependency lookup.
IDX_RELATION_CHILDFIDVX_RELATIONCHILDFID, CHILDTYPEChild dependency lookup.
IDX_RELATION_PARENTCHILDFIDVX_RELATIONPARENTFID, CHILDFID, CHILDTYPEParent/child duplicate/lookup support.
IDX_ACTION_EXECUTIONSEARCHVX_ACTIONPARENTFID, ARCHIVED, EXECUTIONDesigner execution search.
IDX_ACTION_SERVICESEARCHVX_ACTIONACTIVE, ARCHIVED, EXECUTIONService loading.
IDX_API_EXECUTIONSEARCHVX_APIPARENTFID, ARCHIVEDDesigner API tree/search.
IDX_API_SERVICESEARCHVX_APIPARENTFID, ACTIVE, ARCHIVEDAPI service/search support.
IDX_TRANSPORT_EXECUTIONSEARCHVX_TRANSPORTPARENTFID, ARCHIVED, DIRECTIONDesigner transport search.
IDX_TRANSPORT_SERVICESEARCHVX_TRANSPORTACTIVE, ARCHIVED, DIRECTIONService transport loading.
IDX_VARIABLE_CODEVX_VARIABLECODEVariable lookup by code.

Generated Search Indexes

TVxSQL.IndexSearchDefaultFields creates two standard indexes:

PatternColumns
IDX_<table without VX_>_TREESEARCHPARENTFID, FOLDERFID, ARCHIVED, FID
IDX_<table without VX_>_COMBOSEARCHPARENTFID, ARCHIVED, FID

Version 307 creates these indexes for:

  • VX_ACTION
  • VX_DBCON
  • VX_DBDEF
  • VX_FILECON
  • VX_FILEDEF
  • VX_FOLDER
  • VX_MAP
  • VX_REPORT
  • VX_SCRIPTLET
  • VX_SETUP
  • VX_SQLSCRIPT
  • VX_TRANSPORT

Version 308 also creates them for VX_API.

Version 310 would create them for VX_ERROR, but version 310 is not the current effective target version because MajorVersion = 309.

Migrations

Velox migrations are code-based, not standalone SQL scripts in the reviewed repository.

Version Check

TVxDBUpdate.GetVersionFromDatabase reads:

  1. select VERSION from VX_VERSION
  2. a decrypted legacy query for FLO_VERSION if VX_VERSION is not available

TVxDBUpdate.RequireUpdate compares that value to MajorVersion.

Current source value:

MajorVersion = 309

Upgrade Execution

Designer startup runs:

  • SwitchSystemConnectionMode(True)
  • CheckDatabaseUpgrade(True)

With aCheckBoth = True, the updater checks the active test config/log accessors, switches to production, then checks production config/log accessors.

Important source-observed caveat: in the reviewed code, SQLL returns SQLC, so the log database accessor currently points to the config connection. This means the reviewed upgrade path does not show an independent log database upgrade despite the logical Log/LogTest configuration fields.

The services load the configured connection and start. The reviewed VeloxService.dpr and VeloxAPIService.dpr do not call CheckDatabaseUpgrade; they appear to rely on Designer or another operational process to keep the database schema current before service startup.

Migration Version Summary

VersionMain changes
300Renames old FLO_* tables, creates primary module tables, creates VX_VERSION, creates blank setup row.
301Creates/adds VX_SCRIPTLET.
302Creates log tables and log indexes; adds default fields to module tables; adds action/map/transport/file fields; migrates FTP/SFTP class data.
303Adds SQL, trace, and tag log tables and indexes.
304Adds/normalizes ARCHIVED default fields.
305Converts binary fields, adds REST/file/setup/log fields, creates VX_DOC, creates VX_SQLSCRIPT, adds tags/descriptions.
306Adds reported/notified flags to VX_LOG, adds transport fields to VX_LOG_FILE, and shifts file event enum values for existing rows.
307Adds linked action fields, creates VX_RELATION, creates relation indexes, adds parent/change-note fields, creates standard search indexes, optimizes legacy indexes/constraints.
308Adds web setup fields, folder module mask, file retry fields, log file size, REST request/response fields, creates VX_API and VX_API_ACTION, and creates action/API/transport service/search indexes.
309Creates or updates VX_VARIABLE, adds CODE, creates IDX_VARIABLE_CODE, updates folder module masks. This is the current effective target version.
310Source contains a future/error table updater for VX_ERROR, but current MajorVersion is 309.
311Source contains an empty updater class. The dispatcher currently maps version 311 to TVxDBUpdateVersion310, not TVxDBUpdateVersion311. This is source-observed and may be accidental.

Migration Development Notes in Source

The header comments in vxDBUpdateVersion.pas give the workflow for adding a migration:

  1. Increase vxConstant.MajorVersion.
  2. Set the Velox version minimum needed.
  3. Copy the latest update class to create the next version class.
  4. Add database code to the update class.
  5. Add the version to TVxDBUpdate.UpdateDatabase.

Configuration and Persistence Data Flow

Areas That Are Unclear or Source-Observed Caveats

  • The reviewed system schema migration code is SQL Server-specific, even though DB Connection type definitions list other database platforms.
  • SQLL currently returns SQLC; independent log database use is configured conceptually but not active in the reviewed accessor implementation.
  • The database upgrade check is visible in Designer startup, but not in the reviewed service startup paths.
  • VX_DOC is created and has an FID lookup helper, but a complete document module lifecycle was not found in the reviewed code.
  • VX_ERROR is present in a future version 310 updater, but the current effective MajorVersion is 309.
  • The version 311 dispatcher entry creates TVxDBUpdateVersion310, while TVxDBUpdateVersion311 exists and is empty. This may be accidental; the code should be treated as the current source of truth until changed.
  • No foreign-key creation was found in the reviewed schema builder or migrations. Relationships are enforced by application logic and denormalized dependency rows.
  • TVxSQL.IndexSearchDefaultFields registers ARCHIVED with ftGuid while indexing an archived flag column. The field type is not used by index SQL generation, so this did not appear to affect generated index column names, but it is a source-observed inconsistency.