20 lines
627 B
PHP
20 lines
627 B
PHP
<?php
|
|
// setup_push_db.php - Create the table for Push Subscriptions
|
|
require 'koneksi.php';
|
|
|
|
try {
|
|
$sql = "CREATE TABLE IF NOT EXISTS push_subscriptions (
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
id_account INT NOT NULL,
|
|
endpoint TEXT NOT NULL,
|
|
p256dh VARCHAR(255) NOT NULL,
|
|
auth VARCHAR(255) NOT NULL,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
|
|
|
$pdo->exec($sql);
|
|
echo "Tabel `push_subscriptions` berhasil dibuat atau sudah ada.\n";
|
|
} catch (PDOException $e) {
|
|
die("Error creating table: " . $e->getMessage());
|
|
}
|