-- Venue Events Manager — Database update v1.000.007
-- Create Invoice replaces Create Booking; multi-space on quote/invoice;
-- confirm booking on first payment (partially paid / paid).
-- 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.007', 0, NOW(), NOW())
ON DUPLICATE KEY UPDATE `value` = '1.000.007', `updated_at` = NOW();

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

INSERT INTO `settings` (`key`, `value`, `is_encrypted`, `created_at`, `updated_at`)
VALUES (
  'release_notes',
  'v1.000.007: Create Invoice replaces Create Booking; Quotation/Invoice multi-space picker with color-coded available/unavailable dates; booking auto-confirms on first payment (Partially Paid or Paid).',
  0, NOW(), NOW()
)
ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `updated_at` = NOW();

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