CREATE TABLE `ulb_bodies` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `code` varchar(50) NOT NULL, `name_en` varchar(150) NOT NULL, `name_mr` varchar(150) NOT NULL, `ulb_type` varchar(50) NOT NULL DEFAULT 'MUNICIPAL_COUNCIL', `district` varchar(60) NOT NULL, `division` varchar(60) NOT NULL, `established_year` year(4) DEFAULT NULL, `address` text DEFAULT NULL, `commissioner_name` varchar(100) DEFAULT NULL, `email` varchar(100) DEFAULT NULL, `phone` varchar(30) DEFAULT NULL, `logo_url` varchar(255) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT 1, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) ) ENGINE=InnoDB AUTO_INCREMENT=437 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci CREATE TABLE `users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ulb_id` int(10) unsigned NOT NULL, `department_id` int(10) unsigned DEFAULT NULL, `designation_id` int(10) unsigned DEFAULT NULL, `name` varchar(100) NOT NULL, `username` varchar(60) NOT NULL, `email` varchar(100) NOT NULL, `phone` varchar(30) DEFAULT '022-22025225', `password_hash` varchar(255) NOT NULL, `role` varchar(50) NOT NULL DEFAULT 'COMMISSIONER', `status` enum('ACTIVE','INACTIVE','SUSPENDED') NOT NULL DEFAULT 'ACTIVE', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), KEY `fk_users_ulb` (`ulb_id`), CONSTRAINT `fk_users_ulb` FOREIGN KEY (`ulb_id`) REFERENCES `ulb_bodies` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=2978 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci