Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
34 lines
1.2 KiB
PHP
Executable File
34 lines
1.2 KiB
PHP
Executable File
<?php
|
|
|
|
use Openguru\OpenCartFramework\Migrations\Migration;
|
|
|
|
return new class extends Migration {
|
|
public function up(): void
|
|
{
|
|
$tableName = 'megapay_events';
|
|
|
|
$sql = <<<SQL
|
|
CREATE TABLE IF NOT EXISTS `{$tableName}` (
|
|
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
`event` VARCHAR(255) NOT NULL,
|
|
`payload` TEXT NOT NULL,
|
|
`idempotency_key` VARCHAR(64) NOT NULL,
|
|
`event_time` DATETIME NOT NULL,
|
|
`status` VARCHAR(50) NOT NULL DEFAULT 'pending',
|
|
`attempts_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
|
|
`error_reason` TEXT DEFAULT NULL,
|
|
`created_at` DATETIME NOT NULL,
|
|
`updated_at` DATETIME NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `unique_idempotency_key` (`idempotency_key`),
|
|
KEY `idx_status` (`status`),
|
|
KEY `idx_event_time` (`event_time`),
|
|
KEY `idx_updated_at` (`updated_at`)
|
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
|
SQL;
|
|
|
|
$this->database->statement($sql);
|
|
}
|
|
};
|
|
|