-- Migration: Insert initial admin user
-- Date: 2025-01-XX
-- Description: Creates the initial admin user for the admin panel

-- Insert initial admin user
-- Email: abeshima@itbc.co.jp
-- Password: PPTadmin-2025
-- Password hash generated using: pbkdf2(password, salt, 310000, 32, 'sha256')
-- Note: ON DUPLICATE KEY UPDATE ensures the user is created or updated if already exists
INSERT INTO admin_users (id, name, email, password_hash, created_at, updated_at, deleted_at)
VALUES (
    '00000000-0000-0000-0000-000000000001',
    '初期管理者',
    'abeshima@itbc.co.jp',
    '59fe05e529deb7d80934e7f5a0ed95e6:28b1d9b7504a69480b5ffa1bc53682093ccbaf69156731ff8a6b37d620ea119a',
    CURRENT_TIMESTAMP,
    CURRENT_TIMESTAMP,
    NULL
)
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    password_hash = VALUES(password_hash),
    deleted_at = NULL,
    updated_at = CURRENT_TIMESTAMP;

