-- Venue Events Manager — Database update v1.000.006
-- Invoice show: attachments under line items; payment-driven status rules.
-- No schema changes. Import via phpMyAdmin → Import (MySQL / MariaDB).

SET NAMES utf8mb4;

INSERT INTO `settings` (`key`, `value`, `is_encrypted`, `created_at`, `updated_at`)
VALUES ('schema_version', '1.000.006', 0, NOW(), NOW())
ON DUPLICATE KEY UPDATE `value` = '1.000.006', `updated_at` = NOW();

INSERT INTO `settings` (`key`, `value`, `is_encrypted`, `created_at`, `updated_at`)
VALUES ('app_version', '1.000.006', 0, NOW(), NOW())
ON DUPLICATE KEY UPDATE `value` = '1.000.006', `updated_at` = NOW();

INSERT INTO `settings` (`key`, `value`, `is_encrypted`, `created_at`, `updated_at`)
VALUES (
  'release_notes',
  'v1.000.006: Invoice attachments under Line Items; status forced by payments (partial→Partially Paid / full→Paid, only Refunded allowed); no payments → Issued / Overdue / Void only.',
  0, NOW(), NOW()
)
ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `updated_at` = NOW();

SELECT 'Update v1.000.006 applied successfully' AS result;
