
CREATE TABLE IF NOT EXISTS surat (
  id INT AUTO_INCREMENT PRIMARY KEY,
  id_warga INT,
  jenis_surat VARCHAR(100),
  tempat_tanggal_lahir VARCHAR(100),
  jenis_file VARCHAR(50),
  status ENUM('Pending','Diproses','Selesai') DEFAULT 'Pending',
  tanggal TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (id_warga) REFERENCES warga(id)
);
CREATE TABLE IF NOT EXISTS dokumen (
  id INT AUTO_INCREMENT PRIMARY KEY,
  id_surat INT,
  file_ktp VARCHAR(255),
  file_selfie VARCHAR(255),
  FOREIGN KEY (id_surat) REFERENCES surat(id)
);
CREATE TABLE IF NOT EXISTS berita (
  id INT AUTO_INCREMENT PRIMARY KEY,
  judul VARCHAR(200),
  ringkas TEXT,
  tanggal TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS galeri (
  id INT AUTO_INCREMENT PRIMARY KEY,
  judul VARCHAR(200),
  file VARCHAR(255),
  tanggal TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
