CREATE TABLE IF NOT EXISTS `{{TABLE_PREFIX}}_voter_house` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `house_id` TEXT NOT NULL,
  `house_number` TEXT NOT NULL,
  `house_name` TEXT,
  `house_ownership_type` TINYINT DEFAULT NULL,
  `house_owner_id` INT,
  `house_owner_name` TEXT,
  `house_owner_gender` TEXT NULL,
  `phone` TEXT,
  `alt_phone` TEXT,
  `total_family_members` INT DEFAULT '0',
  `landline` TEXT,
  `latitude` TEXT,
  `longitude` TEXT,
  `location` TEXT,
  `landmark` TEXT,
  `digipin` TEXT,
  `state` TEXT,
  `district` TEXT,
  `parliament` TEXT,
  `assembly` TEXT,
  `localbody` TEXT,
  `ward` INT,
  `booth` TEXT,
  `postoffice` TEXT,
  `regional_issue_id` TEXT,
  `created_by` TEXT,
  `created_on` TEXT,
  `created_at` TEXT,
  `created_ip` TEXT,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;




CREATE TABLE IF NOT EXISTS `{{TABLE_PREFIX}}_voter_house` (
  `id` int NOT NULL AUTO_INCREMENT,
  `house_id` text NOT NULL,
  `house_number` text NOT NULL,
  `house_name` text,
  `house_ownership_type` enum('Owned','Rented','Leased','Homeless') DEFAULT NULL,
  `home_structure_or_building_type` text,
  `income_status` text,
  `family_income` bigint DEFAULT NULL,
  `any_animals` tinyint DEFAULT NULL,
  `any_agricultural_farming` tinyint DEFAULT NULL,
  `agricultural_remark` text,
  `own_land_in_constituency` tinyint DEFAULT NULL,
  `own_land_in_constituency_size` int DEFAULT NULL,
  `own_land_in_constituency_unit` enum('Acre','Cent','Hectare','Square Feet','Square Meter') DEFAULT NULL,
  `have_vehicles` tinyint DEFAULT NULL,
  `most_common_transportation` text,
  `internet_connectivity` tinyint DEFAULT NULL,
  `family_health_insurance_status` tinyint DEFAULT NULL,
  `home_or_building_insurance` tinyint DEFAULT NULL,
  `streetlight_working` tinyint DEFAULT NULL,
  `streetlight_remark` text,
  `house_owner_id` int DEFAULT NULL,
  `house_owner_name` text,
  `house_owner_gender` text,
  `phone` text,
  `alt_phone` text,
  `total_family_members` int DEFAULT NULL,
  `landline` text,
  `latitude` text,
  `longitude` text,
  `location` text,
  `landmark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `digipin` text,
  `state` text,
  `district` text,
  `parliament` text,
  `assembly` text,
  `localbody` text,
  `ward` int DEFAULT NULL,
  `booth` text,
  `postoffice` text,
  `regional_issue_id` text,
  `created_by` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `created_on` text,
  `created_at` text,
  `created_ip` text,
  PRIMARY KEY (`id`),
  KEY `{{TABLE_PREFIX}}_voter_house_ibfk_1` (`house_owner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8422 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
