<?php

declare(strict_types=1);

namespace SecurWP\Modules\Hardening\Migrations;

use SecurWP\Core\Database\Migration;
use SecurWP\Core\Installer;
use SecurWP\Modules\Hardening\LoginAttemptStore;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

final class LoginAttemptSchemaV1 implements Migration {

	public function module_key(): string {
		return 'hardening';
	}

	public function target_version(): int {
		return 1;
	}

	public function is_applied(): bool {
		return LoginAttemptStore::is_schema_current();
	}

	public function apply(): bool {
		Installer::ensure_login_attempts_table_schema();
		return true;
	}
}
