Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE IF NOT EXISTS `customers` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `gender` enum('Male','Female') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Male',
- `type` enum('Lead','Insured') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Lead',
- `phone_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `pincode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
- `status` enum('Active','Deleted') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Active',
- `created_by` int(10) unsigned NOT NULL,
- `created_at` timestamp NULL DEFAULT NULL,
- `updated_at` timestamp NULL DEFAULT NULL,
- `state_id` int(10) unsigned NOT NULL DEFAULT '1',
- `district_id` int(10) unsigned NOT NULL DEFAULT '1',
- `policy_id` int(10) unsigned DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `customers_created_by_foreign` (`created_by`),
- KEY `customers_state_id_foreign` (`state_id`),
- KEY `customers_district_id_foreign` (`district_id`),
- KEY `customers_policy_id_foreign` (`policy_id`),
- CONSTRAINT `customers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
- CONSTRAINT `customers_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`),
- CONSTRAINT `customers_policy_id_foreign` FOREIGN KEY (`policy_id`) REFERENCES `policies` (`id`),
- CONSTRAINT `customers_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- CREATE TABLE IF NOT EXISTS `policies` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `insurer_id` int(10) unsigned NOT NULL,
- `policy_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `vehicle_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
- `sum_insured` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `policy_period_from` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `policy_period_to` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `premium_amt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `payment_date` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
- `gst` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
- `payment_method` enum('Cash','Cheque','Card') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Cash',
- `status` enum('Active','Deleted') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Active',
- `created_by` int(10) unsigned NOT NULL,
- `created_at` timestamp NULL DEFAULT NULL,
- `updated_at` timestamp NULL DEFAULT NULL,
- `policy_type_id` int(10) unsigned NOT NULL DEFAULT '1',
- `cheque_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
- `psop_id` int(10) unsigned NOT NULL DEFAULT '1',
- PRIMARY KEY (`id`),
- KEY `policy_created_by_foreign` (`created_by`),
- KEY `policy_insurer_id_foreign` (`insurer_id`),
- KEY `policies_policy_type_id_foreign` (`policy_type_id`),
- KEY `policies_posp_id_foreign` (`psop_id`),
- CONSTRAINT `policies_policy_type_id_foreign` FOREIGN KEY (`policy_type_id`) REFERENCES `policy_types` (`id`),
- CONSTRAINT `policies_posp_id_foreign` FOREIGN KEY (`psop_id`) REFERENCES `users` (`id`),
- CONSTRAINT `policy_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
- CONSTRAINT `policy_insurer_id_foreign` FOREIGN KEY (`insurer_id`) REFERENCES `insurers` (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement