second commit
This commit is contained in:
+49
-9
@@ -12,15 +12,55 @@ USE webgis_db;
|
||||
-- Stores all point-type features (SPBU, Mosque, Poor Population)
|
||||
-- ------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS points (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
category ENUM('spbu','mosque','poor') NOT NULL COMMENT 'spbu=Gas Station, mosque=Mosque, poor=Poor Population',
|
||||
subtype VARCHAR(100) DEFAULT NULL COMMENT 'For SPBU: 24hours or not24hours',
|
||||
latitude DECIMAL(10,8) NOT NULL,
|
||||
longitude DECIMAL(11,8) NOT NULL,
|
||||
description TEXT DEFAULT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
category ENUM('spbu','mosque','poor') NOT NULL COMMENT 'spbu=Gas Station, mosque=Mosque, poor=Poor Population',
|
||||
subtype VARCHAR(100) DEFAULT NULL COMMENT 'For SPBU: 24hours or not24hours',
|
||||
latitude DECIMAL(10,8) NOT NULL,
|
||||
longitude DECIMAL(11,8) NOT NULL,
|
||||
description TEXT DEFAULT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
tanggal_lahir DATE DEFAULT NULL,
|
||||
pendidikan VARCHAR(100) DEFAULT NULL,
|
||||
pekerjaan VARCHAR(100) DEFAULT NULL,
|
||||
jumlah_tanggungan INT DEFAULT NULL,
|
||||
riwayat_penyakit TEXT DEFAULT NULL,
|
||||
alamat TEXT DEFAULT NULL,
|
||||
status_verifikasi ENUM('Menunggu Verifikasi','Layak','Tidak Layak','Perlu Verifikasi Ulang') DEFAULT 'Menunggu Verifikasi'
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ------------------------------------------------------------
|
||||
-- TABLE: laporan_masyarakat
|
||||
-- Stores reports submitted by citizens about poor populations
|
||||
-- ------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS laporan_masyarakat (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
nama_pelapor VARCHAR(100) NOT NULL,
|
||||
no_hp VARCHAR(20) DEFAULT NULL,
|
||||
nama_warga VARCHAR(100) NOT NULL,
|
||||
alamat TEXT DEFAULT NULL,
|
||||
latitude DECIMAL(10,8) DEFAULT NULL,
|
||||
longitude DECIMAL(11,8) DEFAULT NULL,
|
||||
keterangan TEXT DEFAULT NULL,
|
||||
status ENUM('Menunggu Verifikasi','Disetujui','Ditolak') DEFAULT 'Menunggu Verifikasi',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ------------------------------------------------------------
|
||||
-- TABLE: bantuan
|
||||
-- Stores aid distribution records for poor populations
|
||||
-- ------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS bantuan (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
point_id INT NOT NULL,
|
||||
jenis_bantuan VARCHAR(100) NOT NULL,
|
||||
nominal DECIMAL(12,2) DEFAULT NULL,
|
||||
tanggal_bantuan DATE DEFAULT NULL,
|
||||
instansi_pemberi VARCHAR(100) DEFAULT NULL,
|
||||
keterangan TEXT DEFAULT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (point_id) REFERENCES points (id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user