<?php
declare(strict_types=1);

return [
    'up' => "
CREATE TABLE IF NOT EXISTS parent_tokens (
    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    parent_id BIGINT UNSIGNED NOT NULL,
    token VARCHAR(64) NOT NULL UNIQUE,
    name VARCHAR(100) NOT NULL DEFAULT 'mobile',
    device_info VARCHAR(255) NULL,
    push_token VARCHAR(500) NULL,
    device_platform VARCHAR(10) NULL,
    last_used_at DATETIME NULL,
    expires_at DATETIME NULL,
    is_revoked TINYINT(1) NOT NULL DEFAULT 0,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    INDEX idx_parent_id (parent_id),
    INDEX idx_expires (expires_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
",
    'down' => "DROP TABLE IF EXISTS parent_tokens",
];
