# Database target

## Decision

Crakey v2 migrations target **MySQL 8.0+ or MariaDB 10.6+ using InnoDB and utf8mb4**.

Evidence in the supplied project consistently uses MySQL: its environment defaults to `DB_CONNECTION=mysql`; deployment, concurrency, backup and recovery procedures explicitly require MySQL; and the intended Namecheap environment is expected to provide MySQL/MariaDB. The `staging-v2.crakey.com` endpoint did not provide a verifiable application/database response, and no authenticated hosting or database control plane is available here.

Consequently, migrations use MySQL-family syntax, application-generated UUIDs stored as `BINARY(16)`, integer minor-unit money, InnoDB foreign keys, and generated nullable keys for single-current-row constraints. Inventory reservation must use a short transaction with `SELECT ... FOR UPDATE`; `SKIP LOCKED` may be used only after the deployed version is confirmed to support it. DDL is not wrapped in a false transactional guarantee because MySQL-family DDL can implicitly commit.

## Required staging verification

Before migration status can become PASS, capture read-only results for `SELECT VERSION()`, `SELECT @@version_comment`, `SELECT @@transaction_isolation`, and relevant `innodb` variables. Execute migrations on a disposable staging database and run concurrent reservation tests on that exact engine/version.

Status: **NOT TESTED** on `staging-v2.crakey.com`; no credentials or confirmed database endpoint were available.
