281 lines
11 KiB
SQL
281 lines
11 KiB
SQL
/*M!999999\- enable the sandbox mode */
|
|
-- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64)
|
|
--
|
|
-- Host: 127.0.0.1 Database: app_37684
|
|
-- ------------------------------------------------------
|
|
-- Server version 10.11.14-MariaDB-0+deb12u2
|
|
|
|
/*!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 */;
|
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|
/*!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 */;
|
|
|
|
--
|
|
-- Table structure for table `lpa_applications`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `lpa_applications`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `lpa_applications` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`practice_id` int(11) DEFAULT 1,
|
|
`user_id` int(11) DEFAULT NULL,
|
|
`customer_email` varchar(255) DEFAULT NULL,
|
|
`lpa_type` enum('Health & Welfare','Property & Financial') NOT NULL,
|
|
`donor_name` varchar(255) DEFAULT NULL,
|
|
`other_names` varchar(255) DEFAULT NULL,
|
|
`donor_dob` date DEFAULT NULL,
|
|
`donor_address_line1` varchar(255) DEFAULT NULL,
|
|
`donor_address_line2` varchar(255) DEFAULT NULL,
|
|
`donor_town` varchar(255) DEFAULT NULL,
|
|
`donor_postcode` varchar(20) DEFAULT NULL,
|
|
`donor_phone` varchar(20) DEFAULT NULL,
|
|
`status` enum('draft','completed') DEFAULT 'draft',
|
|
`step_reached` int(11) DEFAULT 1,
|
|
`attorney_decision_type` varchar(255) DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
|
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
|
`life_sustaining_treatment` enum('Option A','Option B') DEFAULT NULL,
|
|
`witness_title` varchar(20) DEFAULT NULL,
|
|
`witness_first_name` varchar(255) DEFAULT NULL,
|
|
`witness_last_name` varchar(255) DEFAULT NULL,
|
|
`witness_address_line1` varchar(255) DEFAULT NULL,
|
|
`witness_address_line2` varchar(255) DEFAULT NULL,
|
|
`witness_address_line3` varchar(255) DEFAULT NULL,
|
|
`witness_postcode` varchar(20) DEFAULT NULL,
|
|
`preferences` text DEFAULT NULL,
|
|
`instructions` text DEFAULT NULL,
|
|
`certificate_provider_title` varchar(20) DEFAULT NULL,
|
|
`certificate_provider_first_name` varchar(255) DEFAULT NULL,
|
|
`certificate_provider_last_name` varchar(255) DEFAULT NULL,
|
|
`certificate_provider_address_line1` varchar(255) DEFAULT NULL,
|
|
`certificate_provider_address_line2` varchar(255) DEFAULT NULL,
|
|
`certificate_provider_address_line3` varchar(255) DEFAULT NULL,
|
|
`certificate_provider_postcode` varchar(20) DEFAULT NULL,
|
|
`registration_who` varchar(20) DEFAULT NULL,
|
|
`registering_attorneys_ids` text DEFAULT NULL,
|
|
`correspondence_who` varchar(20) DEFAULT NULL,
|
|
`correspondence_attorney_id` int(11) DEFAULT NULL,
|
|
`correspondence_title` varchar(20) DEFAULT NULL,
|
|
`correspondence_first_name` varchar(255) DEFAULT NULL,
|
|
`correspondence_last_name` varchar(255) DEFAULT NULL,
|
|
`correspondence_company_name` varchar(255) DEFAULT NULL,
|
|
`correspondence_address_line1` varchar(255) DEFAULT NULL,
|
|
`correspondence_address_line2` varchar(255) DEFAULT NULL,
|
|
`correspondence_address_line3` varchar(255) DEFAULT NULL,
|
|
`correspondence_postcode` varchar(20) DEFAULT NULL,
|
|
`correspondence_contact_preference` varchar(50) DEFAULT NULL,
|
|
`correspondence_phone` varchar(20) DEFAULT NULL,
|
|
`correspondence_email` varchar(255) DEFAULT NULL,
|
|
`payment_method` varchar(20) DEFAULT NULL,
|
|
`payment_phone` varchar(20) DEFAULT NULL,
|
|
`reduced_fee_eligibility` varchar(10) DEFAULT NULL,
|
|
`is_repeat_application` tinyint(1) DEFAULT 0,
|
|
`repeat_case_number` varchar(50) DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `fk_user_id` (`user_id`),
|
|
CONSTRAINT `fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
|
|
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `lpa_applications`
|
|
--
|
|
|
|
LOCK TABLES `lpa_applications` WRITE;
|
|
/*!40000 ALTER TABLE `lpa_applications` DISABLE KEYS */;
|
|
/*!40000 ALTER TABLE `lpa_applications` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `lpa_attorneys`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `lpa_attorneys`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `lpa_attorneys` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`lpa_id` int(11) NOT NULL,
|
|
`type` enum('primary','replacement') DEFAULT 'primary',
|
|
`title` varchar(20) DEFAULT NULL,
|
|
`first_name` varchar(255) NOT NULL,
|
|
`last_name` varchar(255) NOT NULL,
|
|
`email` varchar(255) NOT NULL,
|
|
`dob` date NOT NULL,
|
|
`address_line1` varchar(255) NOT NULL,
|
|
`address_line2` varchar(255) DEFAULT NULL,
|
|
`address_line3` varchar(255) DEFAULT NULL,
|
|
`town` varchar(255) NOT NULL,
|
|
`postcode` varchar(20) NOT NULL,
|
|
`relationship` varchar(100) DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
|
`witness_title` varchar(255) DEFAULT NULL,
|
|
`witness_first_name` varchar(255) DEFAULT NULL,
|
|
`witness_last_name` varchar(255) DEFAULT NULL,
|
|
`witness_address_line1` varchar(255) DEFAULT NULL,
|
|
`witness_address_line2` varchar(255) DEFAULT NULL,
|
|
`witness_address_line3` varchar(255) DEFAULT NULL,
|
|
`witness_postcode` varchar(255) DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `lpa_id` (`lpa_id`),
|
|
CONSTRAINT `lpa_attorneys_ibfk_1` FOREIGN KEY (`lpa_id`) REFERENCES `lpa_applications` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `lpa_attorneys`
|
|
--
|
|
|
|
LOCK TABLES `lpa_attorneys` WRITE;
|
|
/*!40000 ALTER TABLE `lpa_attorneys` DISABLE KEYS */;
|
|
/*!40000 ALTER TABLE `lpa_attorneys` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `lpa_notified_persons`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `lpa_notified_persons`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `lpa_notified_persons` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`application_id` int(11) NOT NULL,
|
|
`title` varchar(20) DEFAULT NULL,
|
|
`first_name` varchar(100) DEFAULT NULL,
|
|
`last_name` varchar(100) DEFAULT NULL,
|
|
`address_line1` varchar(255) DEFAULT NULL,
|
|
`address_line2` varchar(255) DEFAULT NULL,
|
|
`address_line3` varchar(255) DEFAULT NULL,
|
|
`postcode` varchar(20) DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `lpa_notified_persons`
|
|
--
|
|
|
|
LOCK TABLES `lpa_notified_persons` WRITE;
|
|
/*!40000 ALTER TABLE `lpa_notified_persons` DISABLE KEYS */;
|
|
/*!40000 ALTER TABLE `lpa_notified_persons` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `migration_history`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `migration_history`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `migration_history` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`filename` varchar(255) NOT NULL,
|
|
`executed_at` timestamp NULL DEFAULT current_timestamp(),
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `filename` (`filename`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `migration_history`
|
|
--
|
|
|
|
LOCK TABLES `migration_history` WRITE;
|
|
/*!40000 ALTER TABLE `migration_history` DISABLE KEYS */;
|
|
INSERT INTO `migration_history` VALUES
|
|
(1,'01_create_users_table.sql','2026-03-01 00:57:47'),
|
|
(2,'02_update_users_for_signup.sql','2026-03-01 00:57:47'),
|
|
(3,'03_add_reset_password_fields.sql','2026-03-01 00:57:47'),
|
|
(4,'04_add_role_column.sql','2026-03-01 00:57:47'),
|
|
(5,'05_add_user_id_to_lpa_applications.sql','2026-03-01 00:57:47'),
|
|
(6,'06_create_migration_history_table.sql','2026-03-01 00:57:47');
|
|
/*!40000 ALTER TABLE `migration_history` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `practices`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `practices`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `practices` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) NOT NULL,
|
|
`slug` varchar(100) NOT NULL,
|
|
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `slug` (`slug`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `practices`
|
|
--
|
|
|
|
LOCK TABLES `practices` WRITE;
|
|
/*!40000 ALTER TABLE `practices` DISABLE KEYS */;
|
|
INSERT INTO `practices` VALUES
|
|
(1,'Elite Estate Planning','elite-estate','2026-02-28 17:36:29');
|
|
/*!40000 ALTER TABLE `practices` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
|
|
--
|
|
-- Table structure for table `users`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `users`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `users` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) DEFAULT NULL,
|
|
`email` varchar(255) NOT NULL,
|
|
`password` varchar(255) NOT NULL,
|
|
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
|
`is_verified` tinyint(1) DEFAULT 0,
|
|
`verification_token` varchar(64) DEFAULT NULL,
|
|
`role` enum('Standard User','Super User') DEFAULT 'Standard User',
|
|
`reset_token` varchar(64) DEFAULT NULL,
|
|
`reset_expires_at` datetime DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `email` (`email`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
--
|
|
-- Dumping data for table `users`
|
|
--
|
|
|
|
LOCK TABLES `users` WRITE;
|
|
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
|
INSERT INTO `users` VALUES
|
|
(1,NULL,'test@example.com','$2y$10$xeVgbO3f09/R4FF0bEwqSeTH3bdNp1CcDLE6R27Slc6yNBHK8Cxq.','2026-02-28 23:23:36',1,NULL,'Standard User',NULL,NULL),
|
|
(3,'Admin','advice@estateguardians.co.uk','$2y$10$.vu3rXV4RHCa4JIs2GVa/OJvfe4c2dhLOgb60Uw0boPHRCVeDKtq6','2026-03-01 00:00:01',1,NULL,'Super User',NULL,NULL),
|
|
(4,'Neel Shah (Profitise)','neel@profitise.co','$2y$10$332.cCj/4WY6.1r6aPQe1ed4QBwl4AYODFtiEeHymgCrvVapiU956','2026-03-01 00:16:28',1,NULL,'Standard User',NULL,NULL),
|
|
(5,'Neel Shah','neel@neel.me.uk','$2y$10$6.jb/U/rjKYfXJSwzfdmquJBqjij.RDqlhYKmZNnELnNgyA635u0.','2026-03-01 00:36:13',1,NULL,'Standard User',NULL,NULL),
|
|
(6,'Cogent FS','cogentfs@gmail.com','$2y$10$g23tK9toSrpgqQKXF7902eK7P5Hg98VtYZd4lB4O1Vpi/XtY.KlEq','2026-03-01 00:39:16',1,NULL,'Standard User',NULL,NULL);
|
|
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|
|
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|
/*!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 */;
|
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
|
|
-- Dump completed on 2026-03-01 1:03:59
|