<?php

return <<<'SQL'
CREATE TABLE ledger_entries (
    id CHAR(36) NOT NULL PRIMARY KEY,
    tenant_id CHAR(36) NOT NULL,
    member_id CHAR(36) NOT NULL,
    entry_type VARCHAR(50) NOT NULL,
    amount DECIMAL(10,2) NOT NULL,
    reference_type VARCHAR(100) NOT NULL,
    reference_id CHAR(36) NULL,
    booked_at DATETIME NOT NULL,
    created_at DATETIME NOT NULL,
    updated_at DATETIME NOT NULL,
    FOREIGN KEY (tenant_id) REFERENCES tenants(id),
    FOREIGN KEY (member_id) REFERENCES members(id)
);
SQL;
