
CREATE DATABASE IF NOT EXISTS jalan
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;

USE jalan;

-- Tabel Jalan (Polyline)
CREATE TABLE IF NOT EXISTS jalan (
  id             INT(11)       NOT NULL AUTO_INCREMENT,
  nama_jalan     VARCHAR(255)  NOT NULL,
  status_jalan   ENUM('Nasional','Provinsi','Kabupaten') NOT NULL DEFAULT 'Kabupaten',
  panjang_meter  FLOAT         NOT NULL DEFAULT 0,
  geojson        LONGTEXT      NOT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Tabel Parsil Tanah (Polygon)
CREATE TABLE IF NOT EXISTS parsil_tanah (
  id                   INT(11)       NOT NULL AUTO_INCREMENT,
  nama_parsil          VARCHAR(255)  NOT NULL,
  status_kepemilikan   ENUM('SHM','HGB','HGU','HP') NOT NULL DEFAULT 'SHM',
  luas_m2              FLOAT         NOT NULL DEFAULT 0,
  geojson              LONGTEXT      NOT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
