Update: 2026-05-16 01:51:22
This commit is contained in:
22
backend/api/subscription/setup_cliq_db.php
Normal file
22
backend/api/subscription/setup_cliq_db.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../config/db.php';
|
||||
|
||||
try {
|
||||
$sql = "CREATE TABLE IF NOT EXISTS cliq_payments (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
fingerprint VARCHAR(255) NOT NULL,
|
||||
reference_code VARCHAR(20) NOT NULL UNIQUE,
|
||||
amount DECIMAL(10,2) NOT NULL,
|
||||
plan VARCHAR(50) NOT NULL,
|
||||
status ENUM('pending', 'paid', 'expired') DEFAULT 'pending',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
INDEX (reference_code),
|
||||
INDEX (fingerprint)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||
|
||||
$pdo->exec($sql);
|
||||
echo "Table 'cliq_payments' created or already exists successfully.";
|
||||
} catch (PDOException $e) {
|
||||
echo "Error creating table: " . $e->getMessage();
|
||||
}
|
||||
Reference in New Issue
Block a user