HSLG Media

RecordSchemaV2.php

RecordSchemaV2.php

Source file: backend/database/migrations/RecordSchemaV2.php

Module: backend-database

Size: 55 lines

SHA-256: 123b87a389785ba4040a018c73cea20fc6b6f045283b4a2ccd7d1073d1c2a019

Responsibility

Implements repositories, schema definitions and migration contracts; MariaDB owns originating customer record time.

Declared entry points

  • RecordSchemaV2 — source line 12.
  • VERSION — source line 14.
  • statements — source line 21.

Imports and dependencies

  • Line 4: use Hslg\Backend\Database\TableNames;

Behaviour and audit locations

  • Line 18: * No customers, credentials or test data are seeded.
  • Line 30: created_at datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  • Line 31: updated_at datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  • Line 38: created_at datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  • Line 39: updated_at datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  • Line 49: written_at datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),

Timestamped customer profile records

This migration describes the customer-field record storage and original MariaDB timestamp default required for HSLG's append-only profile history. Each stored value has a unique record UUID and source node, while latest-value reads use the original database-assigned time and record ID tie-break. Test dbDelta compatibility, timestamp precision, indexes and UTC session handling on real MariaDB. Future multi-node import must not replace source times with arrival times.

Relationship to the system

This page is the file-level source reference, not the architecture rationale. Read the module explanation, the corresponding architecture decision and user guide before changing behaviour. Names and line locations above are extracted from this exact source version; they are reference points, not proof that an external service or a phone feature works.

Change verification

Review the entry points and errors in this file, then run the module’s associated tests, source dependency gate, history gate and documentation coverage check. If the file changes an API response, user interaction, data model, deployment or third-party dependency, revise those human explanations and disaster recovery/licensing when relevant. Do not infer actual native or external API operation from source presence.