CREATE DATABASE webgis_parsiltanah;

USE webgis_parsiltanah;

CREATE TABLE jalan (
    id INT AUTO_INCREMENT PRIMARY KEY,
    nama_jalan VARCHAR(100) NOT NULL,
    status_jalan ENUM(
        'Jalan Nasional',
        'Jalan Provinsi',
        'Jalan Kabupaten'
    ) NOT NULL,
    panjang DOUBLE NOT NULL,
    geom JSON NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE parsil_tanah (
    id INT AUTO_INCREMENT PRIMARY KEY,
    nomor_parsil VARCHAR(50) NOT NULL,
    status_kepemilikan ENUM(
        'SHM',
        'HGB',
        'HGU',
        'HP'
    ) NOT NULL,
    luas DOUBLE NOT NULL,
    geom JSON NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
