LPA-Both-V2.1 - Update Admin Dashboard
This commit is contained in:
parent
1593cab59c
commit
121afbf4d7
@ -2,13 +2,14 @@
|
|||||||
/**
|
/**
|
||||||
* Secure Backup Download API
|
* Secure Backup Download API
|
||||||
*
|
*
|
||||||
* Only accessible by authenticated administrators.
|
* Only accessible by authenticated administrators (Super Users).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
// Authentication and role-based access control
|
// Authentication and role-based access control
|
||||||
if (!isset($_SESSION['user_id']) || !isset($_SESSION['role']) || $_SESSION['role'] !== 'admin') {
|
// Consistent with login.php and admin_dashboard.php
|
||||||
|
if (!isset($_SESSION['user_id']) || ($_SESSION['user_role'] ?? '') !== 'Super User') {
|
||||||
http_response_code(403);
|
http_response_code(403);
|
||||||
echo json_encode(['error' => 'Forbidden: Only administrators can access this resource.']);
|
echo json_encode(['error' => 'Forbidden: Only administrators can access this resource.']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@ -51,6 +51,7 @@ $is_hw = ($lpa_type === 'Health & Welfare');
|
|||||||
|
|
||||||
class OfficialLPAPDF extends FPDF {
|
class OfficialLPAPDF extends FPDF {
|
||||||
public $lpa_title = '';
|
public $lpa_title = '';
|
||||||
|
public $lpa_id = '';
|
||||||
|
|
||||||
function Header() {
|
function Header() {
|
||||||
$this->SetFont('Helvetica', 'B', 14);
|
$this->SetFont('Helvetica', 'B', 14);
|
||||||
@ -140,7 +141,8 @@ if ($is_hw) {
|
|||||||
$pdf->FieldBox('Option Selected', $lpa_data['life_sustaining_treatment']);
|
$pdf->FieldBox('Option Selected', $lpa_data['life_sustaining_treatment']);
|
||||||
} else {
|
} else {
|
||||||
$pdf->SectionHeader('Section 5: When can the attorneys make decisions?');
|
$pdf->SectionHeader('Section 5: When can the attorneys make decisions?');
|
||||||
$pdf->FieldBox('Option Selected', $lpa_data['life_sustaining_treatment'] ?? 'Not specified');
|
$val = ($lpa_data['life_sustaining_treatment'] === 'Option A') ? 'As soon as registered' : (($lpa_data['life_sustaining_treatment'] === 'Option B') ? 'Only when I cannot make my own decisions' : 'Not specified');
|
||||||
|
$pdf->FieldBox('Option Selected', $val);
|
||||||
}
|
}
|
||||||
$pdf->Ln(5);
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
|||||||
@ -149,7 +149,8 @@ $pdf->Ln(5);
|
|||||||
// 5. Section 5 varies by type
|
// 5. Section 5 varies by type
|
||||||
if (($lpa_data['lpa_type'] ?? '') === 'Property & Financial') {
|
if (($lpa_data['lpa_type'] ?? '') === 'Property & Financial') {
|
||||||
$pdf->SectionTitle('5. When can the attorneys make decisions?');
|
$pdf->SectionTitle('5. When can the attorneys make decisions?');
|
||||||
$pdf->Field('Option', $lpa_data['life_sustaining_treatment'] ?? 'Not specified'); // Reusing field for simplicity if needed
|
$val = ($lpa_data['life_sustaining_treatment'] === 'Option A') ? 'As soon as registered' : (($lpa_data['life_sustaining_treatment'] === 'Option B') ? 'Only when I cannot make my own decisions' : 'Not specified');
|
||||||
|
$pdf->Field('Option', $val);
|
||||||
} else {
|
} else {
|
||||||
$pdf->SectionTitle('5. Life-Sustaining Treatment');
|
$pdf->SectionTitle('5. Life-Sustaining Treatment');
|
||||||
$pdf->Field('Option', $lpa_data['life_sustaining_treatment']);
|
$pdf->Field('Option', $lpa_data['life_sustaining_treatment']);
|
||||||
|
|||||||
@ -263,7 +263,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
$life_sustaining_treatment = $_POST['life_sustaining_treatment'] ?? '';
|
$life_sustaining_treatment = $_POST['life_sustaining_treatment'] ?? '';
|
||||||
|
|
||||||
if (empty($life_sustaining_treatment)) {
|
if (empty($life_sustaining_treatment)) {
|
||||||
echo json_encode(['success' => false, 'error' => 'Please select an option for life-sustaining treatment.']);
|
echo json_encode(['success' => false, 'error' => 'Please select an option for Section 5.']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
48
apply.php
48
apply.php
@ -49,6 +49,9 @@ if ($step > 1 && !$lpa_id) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$lpa_type = $lpa_data['lpa_type'] ?? 'Health & Welfare';
|
||||||
|
$is_hw = ($lpa_type === 'Health & Welfare');
|
||||||
|
|
||||||
$attorneys = [];
|
$attorneys = [];
|
||||||
$replacement_attorneys = [];
|
$replacement_attorneys = [];
|
||||||
$notified_persons = [];
|
$notified_persons = [];
|
||||||
@ -175,7 +178,7 @@ session_write_close();
|
|||||||
case 2: echo "Attorneys"; break;
|
case 2: echo "Attorneys"; break;
|
||||||
case 3: echo "How decisions are made"; break;
|
case 3: echo "How decisions are made"; break;
|
||||||
case 4: echo "Replacement Attorneys"; break;
|
case 4: echo "Replacement Attorneys"; break;
|
||||||
case 5: echo "Life-sustaining treatment"; break;
|
case 5: echo $is_hw ? "Life-sustaining treatment" : "When can your attorneys make decisions?"; break;
|
||||||
case 6: echo "Witness Information"; break;
|
case 6: echo "Witness Information"; break;
|
||||||
case 7: echo "People to notify"; break;
|
case 7: echo "People to notify"; break;
|
||||||
case 8: echo "Preferences and instructions"; break;
|
case 8: echo "Preferences and instructions"; break;
|
||||||
@ -554,8 +557,13 @@ session_write_close();
|
|||||||
<a href="apply.php?step=5&id=<?php echo $lpa_id; ?>" class="btn btn-primary btn-lg px-5">Continue to Step 5</a>
|
<a href="apply.php?step=5&id=<?php echo $lpa_id; ?>" class="btn btn-primary btn-lg px-5">Continue to Step 5</a>
|
||||||
</div>
|
</div>
|
||||||
<?php elseif ($step === 5): ?>
|
<?php elseif ($step === 5): ?>
|
||||||
<h2 class="h4 fw-bold mb-4">Life-sustaining treatment</h2>
|
<?php if ($is_hw): ?>
|
||||||
<p class="text-muted mb-5">Specify whether your attorneys have authority to give or refuse consent to life-sustaining treatment.</p>
|
<h2 class="h4 fw-bold mb-4">Life-sustaining treatment</h2>
|
||||||
|
<p class="text-muted mb-5">Specify whether your attorneys have authority to give or refuse consent to life-sustaining treatment.</p>
|
||||||
|
<?php else: ?>
|
||||||
|
<h2 class="h4 fw-bold mb-4">When can your attorneys make decisions?</h2>
|
||||||
|
<p class="text-muted mb-5">Specify when you want your attorneys to be able to make decisions about your property and financial affairs.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<form id="lpaFormStep5" class="lpa-form" method="POST" action="api/save_lpa.php">
|
<form id="lpaFormStep5" class="lpa-form" method="POST" action="api/save_lpa.php">
|
||||||
<input type="hidden" name="step" value="5">
|
<input type="hidden" name="step" value="5">
|
||||||
@ -568,7 +576,13 @@ session_write_close();
|
|||||||
<label class="btn btn-outline-secondary w-100 p-3 text-start h-100 d-flex align-items-center" for="lst_a">
|
<label class="btn btn-outline-secondary w-100 p-3 text-start h-100 d-flex align-items-center" for="lst_a">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<div class="fw-bold text-dark mb-1">Option A</div>
|
<div class="fw-bold text-dark mb-1">Option A</div>
|
||||||
<div class="text-muted small">I give my attorneys authority to give or refuse consent to life-sustaining treatment on my behalf.</div>
|
<div class="text-muted small">
|
||||||
|
<?php if ($is_hw): ?>
|
||||||
|
I give my attorneys authority to give or refuse consent to life-sustaining treatment on my behalf.
|
||||||
|
<?php else: ?>
|
||||||
|
As soon as my LPA has been registered (and also when I cannot make my own decisions).
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ms-3">
|
<div class="ms-3">
|
||||||
<div class="form-check-input-placeholder"></div>
|
<div class="form-check-input-placeholder"></div>
|
||||||
@ -581,7 +595,13 @@ session_write_close();
|
|||||||
<label class="btn btn-outline-secondary w-100 p-3 text-start h-100 d-flex align-items-center" for="lst_b">
|
<label class="btn btn-outline-secondary w-100 p-3 text-start h-100 d-flex align-items-center" for="lst_b">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<div class="fw-bold text-dark mb-1">Option B</div>
|
<div class="fw-bold text-dark mb-1">Option B</div>
|
||||||
<div class="text-muted small">I do not give my attorneys authority to give or refuse consent to life-sustaining treatment on my behalf.</div>
|
<div class="text-muted small">
|
||||||
|
<?php if ($is_hw): ?>
|
||||||
|
I do not give my attorneys authority to give or refuse consent to life-sustaining treatment on my behalf.
|
||||||
|
<?php else: ?>
|
||||||
|
Only when I cannot make my own decisions.
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ms-3">
|
<div class="ms-3">
|
||||||
<div class="form-check-input-placeholder"></div>
|
<div class="form-check-input-placeholder"></div>
|
||||||
@ -1266,7 +1286,7 @@ session_write_close();
|
|||||||
</div>
|
</div>
|
||||||
<?php if (empty($replacement_attorneys)): ?>
|
<?php if (empty($replacement_attorneys)): ?>
|
||||||
<div class="text-muted">None appointed.</div>
|
<div class="text-muted">None appointed.</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<?php foreach ($replacement_attorneys as $ra): ?>
|
<?php foreach ($replacement_attorneys as $ra): ?>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
@ -1280,16 +1300,24 @@ session_write_close();
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Step 5: Life Sustaining -->
|
<!-- Step 5: Life Sustaining / When Decisions -->
|
||||||
<div class="summary-section">
|
<div class="summary-section">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||||
<h3 class="h5 fw-bold mb-0">5. Life-sustaining treatment</h3>
|
<h3 class="h5 fw-bold mb-0">5. <?php echo $is_hw ? "Life-sustaining treatment" : "When decisions are made"; ?></h3>
|
||||||
<a href="apply.php?step=5&id=<?php echo $lpa_id; ?>" class="edit-link text-primary">Edit Section</a>
|
<a href="apply.php?step=5&id=<?php echo $lpa_id; ?>" class="edit-link text-primary">Edit Section</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="summary-label">Life-sustaining Treatment Preference</div>
|
<div class="summary-label">Option Selected</div>
|
||||||
<div class="summary-value"><?php echo htmlspecialchars($lpa_data['life_sustaining_treatment'] ?? ''); ?></div>
|
<div class="summary-value">
|
||||||
|
<?php
|
||||||
|
if ($is_hw) {
|
||||||
|
echo htmlspecialchars($lpa_data['life_sustaining_treatment'] ?? '');
|
||||||
|
} else {
|
||||||
|
echo ($lpa_data['life_sustaining_treatment'] === 'Option A') ? 'As soon as registered' : 'Only when I cannot make my own decisions';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
286
backups/backup_2026-03-01_22-06-01.sql
Normal file
286
backups/backup_2026-03-01_22-06-01.sql
Normal file
@ -0,0 +1,286 @@
|
|||||||
|
/*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=7 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 */;
|
||||||
|
INSERT INTO `lpa_applications` VALUES
|
||||||
|
(6,1,5,'neel@neel.me.uk','Health & Welfare','Neel Rameshchandra Shah','','1974-02-16','37 St Andrews Drive','','Stanmore','HA7 2LY',NULL,'completed',14,'Jointly and severally','2026-03-01 19:40:14','2026-03-01 22:03:35','Option A','Mr','Neel','Shah','C/O Estate Guardians','9 Freetrade House','Lowther Road','HA7 1EP','This is where the donor\'s preferences will go','This is where the donor\'s instructions will go','Mr','Certificate','Provider','Cert Providers Address 1','Cert Providers Address 2','Cert Providers Address 3','CP1 1PC','donor','','Donor',NULL,'','','','','','','','','Post','','','Card','07958218774','No',0,'');
|
||||||
|
/*!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=16 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 */;
|
||||||
|
INSERT INTO `lpa_attorneys` VALUES
|
||||||
|
(14,6,'primary','Mrs','Pallavi','Shah','pallavi@neel.me.uk','1979-07-29','37 St Andrews Drive','','','Stanmore','HA7 2LY',NULL,'2026-03-01 19:47:40','Mr','Certificate','Provider','Cert Providers Address 1','Cert Providers Address 2','Cert Providers Address 3','CP1 1PC'),
|
||||||
|
(15,6,'primary','Mr','Sanay','Shah','sanay@neel.me.uk','2007-03-16','37 St Andrews Drive','','','Stanmore','HA7 2LY',NULL,'2026-03-01 19:48:14','Mr','Certificate','Provider','Cert Providers Address 1','Cert Providers Address 2','Cert Providers Address 3','CP1 1PC');
|
||||||
|
/*!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,
|
||||||
|
`credits` int(11) DEFAULT 0,
|
||||||
|
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,0),
|
||||||
|
(3,'Admin','advice@estateguardians.co.uk','$2y$10$.vu3rXV4RHCa4JIs2GVa/OJvfe4c2dhLOgb60Uw0boPHRCVeDKtq6','2026-03-01 00:00:01',1,NULL,'Super User',NULL,NULL,0),
|
||||||
|
(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,0),
|
||||||
|
(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,0),
|
||||||
|
(6,'Cogent FS','cogentfs@gmail.com','$2y$10$g23tK9toSrpgqQKXF7902eK7P5Hg98VtYZd4lB4O1Vpi/XtY.KlEq','2026-03-01 00:39:16',1,NULL,'Standard User',NULL,NULL,0);
|
||||||
|
/*!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 22:06:02
|
||||||
286
backups/backup_2026-03-01_22-09-56.sql
Normal file
286
backups/backup_2026-03-01_22-09-56.sql
Normal file
@ -0,0 +1,286 @@
|
|||||||
|
/*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=7 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 */;
|
||||||
|
INSERT INTO `lpa_applications` VALUES
|
||||||
|
(6,1,5,'neel@neel.me.uk','Health & Welfare','Neel Rameshchandra Shah','','1974-02-16','37 St Andrews Drive','','Stanmore','HA7 2LY',NULL,'completed',14,'Jointly and severally','2026-03-01 19:40:14','2026-03-01 22:03:35','Option A','Mr','Neel','Shah','C/O Estate Guardians','9 Freetrade House','Lowther Road','HA7 1EP','This is where the donor\'s preferences will go','This is where the donor\'s instructions will go','Mr','Certificate','Provider','Cert Providers Address 1','Cert Providers Address 2','Cert Providers Address 3','CP1 1PC','donor','','Donor',NULL,'','','','','','','','','Post','','','Card','07958218774','No',0,'');
|
||||||
|
/*!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=16 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 */;
|
||||||
|
INSERT INTO `lpa_attorneys` VALUES
|
||||||
|
(14,6,'primary','Mrs','Pallavi','Shah','pallavi@neel.me.uk','1979-07-29','37 St Andrews Drive','','','Stanmore','HA7 2LY',NULL,'2026-03-01 19:47:40','Mr','Certificate','Provider','Cert Providers Address 1','Cert Providers Address 2','Cert Providers Address 3','CP1 1PC'),
|
||||||
|
(15,6,'primary','Mr','Sanay','Shah','sanay@neel.me.uk','2007-03-16','37 St Andrews Drive','','','Stanmore','HA7 2LY',NULL,'2026-03-01 19:48:14','Mr','Certificate','Provider','Cert Providers Address 1','Cert Providers Address 2','Cert Providers Address 3','CP1 1PC');
|
||||||
|
/*!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,
|
||||||
|
`credits` int(11) DEFAULT 0,
|
||||||
|
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,0),
|
||||||
|
(3,'Admin','advice@estateguardians.co.uk','$2y$10$.vu3rXV4RHCa4JIs2GVa/OJvfe4c2dhLOgb60Uw0boPHRCVeDKtq6','2026-03-01 00:00:01',1,NULL,'Super User',NULL,NULL,0),
|
||||||
|
(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,0),
|
||||||
|
(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,0),
|
||||||
|
(6,'Cogent FS','cogentfs@gmail.com','$2y$10$g23tK9toSrpgqQKXF7902eK7P5Hg98VtYZd4lB4O1Vpi/XtY.KlEq','2026-03-01 00:39:16',1,NULL,'Standard User',NULL,NULL,0);
|
||||||
|
/*!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 22:09:56
|
||||||
@ -1,2 +1,16 @@
|
|||||||
-- Add credits column to users table
|
-- Add credits column to users table if not exists
|
||||||
ALTER TABLE users ADD COLUMN credits INT DEFAULT 0;
|
SET @dbname = DATABASE();
|
||||||
|
SET @tablename = 'users';
|
||||||
|
SET @columnname = 'credits';
|
||||||
|
SET @preparedStatement = (SELECT IF(
|
||||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE TABLE_SCHEMA = @dbname
|
||||||
|
AND TABLE_NAME = @tablename
|
||||||
|
AND COLUMN_NAME = @columnname
|
||||||
|
) > 0,
|
||||||
|
'SELECT 1',
|
||||||
|
'ALTER TABLE users ADD COLUMN credits INT DEFAULT 0'
|
||||||
|
));
|
||||||
|
PREPARE stmt FROM @preparedStatement;
|
||||||
|
EXECUTE stmt;
|
||||||
|
DEALLOCATE PREPARE stmt;
|
||||||
Loading…
x
Reference in New Issue
Block a user