30 lines
1.2 KiB
PHP
30 lines
1.2 KiB
PHP
<?php
|
|
include 'koneksi.php';
|
|
|
|
try {
|
|
$pdo->exec("
|
|
CREATE TABLE IF NOT EXISTS profile (
|
|
id_profile INT AUTO_INCREMENT PRIMARY KEY,
|
|
id_account INT NOT NULL UNIQUE,
|
|
email VARCHAR(255) DEFAULT NULL,
|
|
moto VARCHAR(500) DEFAULT NULL,
|
|
provinsi VARCHAR(100) DEFAULT NULL,
|
|
kabupaten VARCHAR(100) DEFAULT NULL,
|
|
kecamatan VARCHAR(100) DEFAULT NULL,
|
|
desa VARCHAR(100) DEFAULT NULL,
|
|
kode_pos VARCHAR(10) DEFAULT NULL,
|
|
facebook VARCHAR(255) DEFAULT NULL,
|
|
instagram VARCHAR(255) DEFAULT NULL,
|
|
linkedin VARCHAR(255) DEFAULT NULL,
|
|
whatsapp VARCHAR(20) DEFAULT NULL,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
FOREIGN KEY (id_account) REFERENCES account(id_account) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
|
");
|
|
echo json_encode(['status' => 'success', 'message' => 'Tabel profile berhasil dibuat.']);
|
|
} catch (PDOException $e) {
|
|
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
|
|
}
|
|
?>
|