CREATE DATABASE IF NOT EXISTS `02_spbudb` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE `02_spbudb`;
-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 11, 2026 at 11:13 AM
-- Server version: 8.4.3
-- PHP Version: 8.3.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `02_spbudb`
--

-- --------------------------------------------------------

--
-- Table structure for table `polygon`
--

CREATE TABLE `polygon` (
  `id` int NOT NULL,
  `nama_polygon` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `keterangan` text COLLATE utf8mb4_unicode_ci,
  `warna` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#22c55e',
  `koordinat` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `polygon`
--

INSERT INTO `polygon` (`id`, `nama_polygon`, `keterangan`, `warna`, `koordinat`, `created_at`, `updated_at`) VALUES
(1, 'Rumah A', 'Rumah A di tepi jalan imbon', '#c42170', '[[-0.04619857363388995,109.35349255800249],[-0.04609122197957324,109.35370445251466],[-0.046228095338798736,109.35379564762117],[-0.04634349836696752,109.35357302427295]]', '2026-06-08 09:59:46', '2026-06-08 09:59:46');

-- --------------------------------------------------------

--
-- Table structure for table `polyline`
--

CREATE TABLE `polyline` (
  `id` int NOT NULL,
  `nama_line` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `keterangan` text COLLATE utf8mb4_unicode_ci,
  `warna` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#3b82f6',
  `koordinat` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `polyline`
--

INSERT INTO `polyline` (`id`, `nama_line`, `keterangan`, `warna`, `koordinat`, `created_at`, `updated_at`) VALUES
(1, 'Jl Tanjung Sari', 'Jalan tembusan \'TanSar\", dari mulut di ImBon dan dari mulut Jl. Jend. Ayani', '#3b82f6', '[[-0.052839376622127024,109.34751927852632],[-0.05137402667155636,109.34858143329622],[-0.050509845915652725,109.34916079044343],[-0.04923236129902831,109.35004591941835],[-0.04847016458323742,109.35060918331146],[-0.04772943818927965,109.35115635395051],[-0.04757377829389879,109.35129046440126],[-0.047589881041730155,109.35139775276186],[-0.04771333544149917,109.35161232948305],[-0.04650562934709907,109.3523955345154],[-0.045646816111789314,109.35296952724458],[-0.0457756380977098,109.35312509536745]]', '2026-06-08 10:03:20', '2026-06-08 10:03:20');

-- --------------------------------------------------------

--
-- Table structure for table `spbu`
--

CREATE TABLE `spbu` (
  `id` int NOT NULL,
  `nama_spbu` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status_ramai` enum('ramai','tidak_ramai') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'tidak_ramai',
  `buka_24_jam` enum('ya','tidak') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'tidak',
  `status_operasional` enum('buka','tutup') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'buka',
  `nomor_hp` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `latitude` double NOT NULL,
  `longitude` double NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `spbu`
--

INSERT INTO `spbu` (`id`, `nama_spbu`, `status_ramai`, `buka_24_jam`, `status_operasional`, `nomor_hp`, `latitude`, `longitude`, `created_at`, `updated_at`) VALUES
(4, 'SPBU Imbon', 'ramai', 'ya', 'buka', '0812345678913', -0.046981865484009226, 109.35455471277238, '2026-06-08 09:58:55', '2026-06-08 09:58:55');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `polygon`
--
ALTER TABLE `polygon`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `polyline`
--
ALTER TABLE `polyline`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `spbu`
--
ALTER TABLE `spbu`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `polygon`
--
ALTER TABLE `polygon`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `polyline`
--
ALTER TABLE `polyline`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `spbu`
--
ALTER TABLE `spbu`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

