-- =============================================
-- DATABASE: webgis_jalan
-- Tabel: jalan (Pemetaan Jaringan Jalan)
-- =============================================

CREATE DATABASE IF NOT EXISTS webgis_jalan CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE webgis_jalan;

CREATE TABLE IF NOT EXISTS jalan (
    id      INT AUTO_INCREMENT PRIMARY KEY,
    nama    VARCHAR(255) NOT NULL,
    status  ENUM('Nasional', 'Provinsi', 'Kabupaten') NOT NULL DEFAULT 'Kabupaten',
    panjang DOUBLE NOT NULL DEFAULT 0,
    geom    LINESTRING NOT NULL,
    SPATIAL INDEX (geom)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
