-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               9.4.0 - MySQL Community Server - GPL
-- Server OS:                    Win64
-- HeidiSQL Version:             12.11.0.7065
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


-- Dumping database structure for dinsos-etapinmesra4
CREATE DATABASE IF NOT EXISTS `dinsos-etapinmesra4` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `dinsos-etapinmesra4`;

-- Dumping structure for table dinsos-etapinmesra4.anggota
CREATE TABLE IF NOT EXISTS `anggota` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nik` varchar(50) DEFAULT NULL,
  `nama` varchar(200) DEFAULT NULL,
  `tmp_lahir` varchar(200) DEFAULT NULL,
  `tgl_lahir` date DEFAULT NULL,
  `sex` tinyint DEFAULT NULL,
  `status_perkawinan_id` tinyint DEFAULT NULL,
  `hubungan_keluarga_id` tinyint DEFAULT NULL,
  `keluarga_id` int DEFAULT NULL,
  `kepemilikan_identitas_id` tinyint DEFAULT NULL,
  `partisipasi_sekolah_id` tinyint DEFAULT NULL,
  `pendidikan_terakhir_id` tinyint DEFAULT NULL,
  `jamkes_id` tinyint DEFAULT NULL,
  `disabilitas_id` tinyint DEFAULT NULL,
  `status_lansia` varchar(50) DEFAULT NULL,
  `gepeng` varchar(50) DEFAULT NULL,
  `status_anak_terlantar` varchar(50) DEFAULT NULL,
  `user_id` smallint DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=73119 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.anggota_drafts
CREATE TABLE IF NOT EXISTS `anggota_drafts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nik` varchar(50) DEFAULT NULL,
  `nama` varchar(200) DEFAULT NULL,
  `tmp_lahir` varchar(200) DEFAULT NULL,
  `tgl_lahir` date DEFAULT NULL,
  `sex` tinyint DEFAULT NULL,
  `status_perkawinan_id` tinyint DEFAULT NULL,
  `hubungan_keluarga_id` tinyint DEFAULT NULL,
  `keluarga_id` int DEFAULT NULL,
  `kepemilikan_identitas_id` tinyint DEFAULT NULL,
  `partisipasi_sekolah_id` tinyint DEFAULT NULL,
  `pendidikan_terakhir_id` tinyint DEFAULT NULL,
  `jamkes_id` tinyint DEFAULT NULL,
  `disabilitas_id` tinyint DEFAULT NULL,
  `status_lansia` varchar(50) DEFAULT NULL,
  `gepeng` varchar(50) DEFAULT NULL,
  `status_anak_terlantar` varchar(50) DEFAULT NULL,
  `user_id` smallint DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `action_type` enum('create','update','delete') NOT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `requested_by` bigint unsigned NOT NULL COMMENT 'User yang mengajukan',
  `requested_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `approved_by` bigint unsigned DEFAULT NULL COMMENT 'Admin yang menyetujui',
  `approved_at` timestamp NULL DEFAULT NULL,
  `rejection_reason` text,
  `draft_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `draft_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.aset_bisa_dijual
CREATE TABLE IF NOT EXISTS `aset_bisa_dijual` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.atap
CREATE TABLE IF NOT EXISTS `atap` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.bangunan
CREATE TABLE IF NOT EXISTS `bangunan` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.biaya_obat
CREATE TABLE IF NOT EXISTS `biaya_obat` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.biaya_sekolah
CREATE TABLE IF NOT EXISTS `biaya_sekolah` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.cacat
CREATE TABLE IF NOT EXISTS `cacat` (
  `id` int NOT NULL,
  `value` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.desa
CREATE TABLE IF NOT EXISTS `desa` (
  `id` int NOT NULL AUTO_INCREMENT,
  `kode_desa` varchar(10) DEFAULT NULL,
  `nama_desa` varchar(45) DEFAULT NULL,
  `kecamatan_id` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=136 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.dinding
CREATE TABLE IF NOT EXISTS `dinding` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.disabilitas
CREATE TABLE IF NOT EXISTS `disabilitas` (
  `id` int NOT NULL AUTO_INCREMENT,
  `value` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.energi_memasak
CREATE TABLE IF NOT EXISTS `energi_memasak` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.hubungan_keluarga
CREATE TABLE IF NOT EXISTS `hubungan_keluarga` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.jamkes
CREATE TABLE IF NOT EXISTS `jamkes` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.jumlah_anggota
CREATE TABLE IF NOT EXISTS `jumlah_anggota` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.kecamatan
CREATE TABLE IF NOT EXISTS `kecamatan` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `kode_kecamatan` varchar(6) DEFAULT NULL,
  `nama_kecamatan` varchar(45) DEFAULT NULL,
  `kode_kab` varchar(4) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.keluarga
CREATE TABLE IF NOT EXISTS `keluarga` (
  `id` int NOT NULL AUTO_INCREMENT,
  `kk` varchar(50) DEFAULT NULL,
  `kecamatan_id` int DEFAULT NULL,
  `desa_id` int DEFAULT NULL,
  `alamat` varchar(200) DEFAULT NULL,
  `jumlah_anggota_id` int DEFAULT NULL,
  `bangunan_id` int DEFAULT NULL,
  `luas_bangunan_id` int DEFAULT NULL,
  `atap_id` int DEFAULT NULL,
  `lantai_id` int DEFAULT NULL,
  `transportasi_id` int DEFAULT NULL,
  `dinding_id` int DEFAULT NULL,
  `pakaian_id` int DEFAULT NULL,
  `makan_daging_id` int DEFAULT NULL,
  `makan_id` int DEFAULT NULL,
  `obat_id` int DEFAULT NULL,
  `biaya_sekolah_id` int DEFAULT NULL,
  `sumber_air_id` int DEFAULT NULL,
  `sanitasi_bab_id` int DEFAULT NULL,
  `sumber_penerangan_id` int DEFAULT NULL,
  `energi_memasak_id` int DEFAULT NULL,
  `pendidikan_id` int DEFAULT NULL,
  `pekerjaan_id` int DEFAULT NULL,
  `penghasilan_id` int DEFAULT NULL,
  `aset_bisa_dijual_id` int DEFAULT NULL,
  `p_pkh` tinyint(1) DEFAULT NULL,
  `p_pbnt` tinyint(1) DEFAULT NULL,
  `p_pbi_apbn` tinyint(1) DEFAULT NULL,
  `p_pbi_apbd` tinyint(1) DEFAULT NULL,
  `p_blt` tinyint(1) DEFAULT NULL,
  `p_disabilitas` tinyint(1) DEFAULT NULL,
  `p_alatbantudisabilitas` tinyint(1) DEFAULT NULL,
  `p_lansia` tinyint(1) DEFAULT NULL,
  `p_anakterlantar` tinyint(1) DEFAULT NULL,
  `p_gepeng` tinyint(1) DEFAULT NULL,
  `p_rtlh` tinyint(1) DEFAULT NULL,
  `p_kemiskinan` tinyint(1) DEFAULT NULL,
  `p_inflansi` tinyint(1) DEFAULT NULL,
  `lat` double DEFAULT NULL,
  `long` double DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `is_dtks` tinyint DEFAULT NULL,
  `verifikasi` tinyint DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=73102 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.keluarga_drafts
CREATE TABLE IF NOT EXISTS `keluarga_drafts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `kk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kecamatan_id` bigint unsigned DEFAULT NULL,
  `desa_id` bigint unsigned DEFAULT NULL,
  `alamat` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `jumlah_anggota_id` bigint unsigned DEFAULT NULL,
  `bangunan_id` bigint unsigned DEFAULT NULL,
  `luas_bangunan_id` bigint unsigned DEFAULT NULL,
  `atap_id` bigint unsigned DEFAULT NULL,
  `lantai_id` bigint unsigned DEFAULT NULL,
  `transportasi_id` bigint unsigned DEFAULT NULL,
  `dinding_id` bigint unsigned DEFAULT NULL,
  `pakaian_id` bigint unsigned DEFAULT NULL,
  `makan_daging_id` bigint unsigned DEFAULT NULL,
  `makan_id` bigint unsigned DEFAULT NULL,
  `obat_id` bigint unsigned DEFAULT NULL,
  `biaya_sekolah_id` bigint unsigned DEFAULT NULL,
  `sumber_air_id` bigint unsigned DEFAULT NULL,
  `sanitasi_bab_id` bigint unsigned DEFAULT NULL,
  `sumber_penerangan_id` bigint unsigned DEFAULT NULL,
  `energi_memasak_id` bigint unsigned DEFAULT NULL,
  `pendidikan_id` bigint unsigned DEFAULT NULL,
  `pekerjaan_id` bigint unsigned DEFAULT NULL,
  `penghasilan_id` bigint unsigned DEFAULT NULL,
  `aset_bisa_dijual_id` bigint unsigned DEFAULT NULL,
  `p_pkh` tinyint(1) DEFAULT '0',
  `p_pbnt` tinyint(1) DEFAULT '0',
  `p_pbi_apbn` tinyint(1) DEFAULT '0',
  `p_pbi_apbd` tinyint(1) DEFAULT '0',
  `p_blt` tinyint(1) DEFAULT '0',
  `p_disabilitas` tinyint(1) DEFAULT '0',
  `p_alatbantudisabilitas` tinyint(1) DEFAULT '0',
  `p_lansia` tinyint(1) DEFAULT '0',
  `p_anakterlantar` tinyint(1) DEFAULT '0',
  `p_gepeng` tinyint(1) DEFAULT '0',
  `p_rtlh` tinyint(1) DEFAULT '0',
  `p_kemiskinan` tinyint(1) DEFAULT '0',
  `p_inflansi` tinyint(1) DEFAULT '0',
  `is_dtks` tinyint(1) DEFAULT '0',
  `verifikasi` tinyint(1) DEFAULT '0',
  `lat` double DEFAULT NULL,
  `long` double DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `action_type` enum('create','update','delete') NOT NULL,
  `keluarga_id` bigint unsigned DEFAULT NULL COMMENT 'ID data asli (null untuk create baru)',
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `requested_by` bigint unsigned NOT NULL COMMENT 'User yang mengajukan',
  `requested_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `approved_by` bigint unsigned DEFAULT NULL COMMENT 'Admin yang menyetujui',
  `approved_at` timestamp NULL DEFAULT NULL,
  `rejection_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `draft_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `draft_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.keluarga_logs
CREATE TABLE IF NOT EXISTS `keluarga_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `keluarga_id` bigint unsigned NOT NULL,
  `action` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `old_data` json DEFAULT NULL,
  `new_data` json DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `keluarga_logs_keluarga_id_index` (`keluarga_id`),
  KEY `keluarga_logs_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.kepemilikan_identitas
CREATE TABLE IF NOT EXISTS `kepemilikan_identitas` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.lantai
CREATE TABLE IF NOT EXISTS `lantai` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.luas_bangunan
CREATE TABLE IF NOT EXISTS `luas_bangunan` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.makan
CREATE TABLE IF NOT EXISTS `makan` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.makan_daging
CREATE TABLE IF NOT EXISTS `makan_daging` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.pakaian
CREATE TABLE IF NOT EXISTS `pakaian` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.partisipasi_sekolah
CREATE TABLE IF NOT EXISTS `partisipasi_sekolah` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.pekerjaan
CREATE TABLE IF NOT EXISTS `pekerjaan` (
  `id` int NOT NULL,
  `value` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.pendidikan
CREATE TABLE IF NOT EXISTS `pendidikan` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.penghasilan
CREATE TABLE IF NOT EXISTS `penghasilan` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.ppks
CREATE TABLE IF NOT EXISTS `ppks` (
  `id` int NOT NULL,
  `value` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.sanitasi_bab
CREATE TABLE IF NOT EXISTS `sanitasi_bab` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.sessions
CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.status_perkawinan
CREATE TABLE IF NOT EXISTS `status_perkawinan` (
  `id` int NOT NULL,
  `value` varchar(15) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.sumber_air
CREATE TABLE IF NOT EXISTS `sumber_air` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.sumber_penerangan
CREATE TABLE IF NOT EXISTS `sumber_penerangan` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.transportasi
CREATE TABLE IF NOT EXISTS `transportasi` (
  `id` tinyint NOT NULL DEFAULT '0',
  `value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.user
CREATE TABLE IF NOT EXISTS `user` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `role` tinyint unsigned NOT NULL COMMENT '1=admin, 2=operator, 3=verifikator, 4=pemohon',
  `remember_token` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kecamatan_id` int DEFAULT NULL,
  `desa_id` int DEFAULT NULL,
  `active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user_role` (`role`)
) ENGINE=InnoDB AUTO_INCREMENT=217 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table dinsos-etapinmesra4.usia
CREATE TABLE IF NOT EXISTS `usia` (
  `id` tinyint NOT NULL AUTO_INCREMENT,
  `value` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- Data exporting was unselected.

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
