-- =============================================================================
-- 09-leave-document.sql
-- Migration: LeaveDocument1780980000000
-- Standard MySQL/MariaDB syntax. Safe to re-run migration INSERT only.
-- If column already exists, skip the ALTER line (error #1060).
-- =============================================================================

ALTER TABLE `leaves`
  ADD `document` json NULL AFTER `reason`;

INSERT INTO migrations (timestamp, name)
SELECT 1780980000000, 'LeaveDocument1780980000000'
WHERE NOT EXISTS (
  SELECT 1 FROM migrations WHERE name = 'LeaveDocument1780980000000'
);

SHOW COLUMNS FROM `leaves` LIKE 'document';
