-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 02, 2026 at 05:38 PM
-- Server version: 10.4.27-MariaDB
-- PHP Version: 7.4.33

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!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 */;

--
-- Database: `demo8_mckenzies_friends`
--

-- --------------------------------------------------------

--
-- Table structure for table `comp_company_details_history`
--

CREATE TABLE `comp_company_details_history` (
  `id` int(11) NOT NULL,
  `his_id` int(11) NOT NULL,
  `company_name` varchar(512) NOT NULL,
  `main_contact_name` varchar(256) NOT NULL,
  `primary_email` varchar(512) NOT NULL,
  `primary_phone` varchar(50) NOT NULL,
  `address_line_1` varchar(512) NOT NULL,
  `address_line_2` varchar(512) NOT NULL,
  `town` varchar(256) NOT NULL,
  `county` varchar(25) NOT NULL,
  `postcode` varchar(25) NOT NULL,
  `country` varchar(25) NOT NULL,
  `account_status` tinyint(4) NOT NULL,
  `date_joined` datetime NOT NULL,
  `company_notes` text NOT NULL,
  `billing_same_comp_address` tinyint(4) NOT NULL DEFAULT 0,
  `billing_address_line_1` varchar(512) NOT NULL,
  `billing_address_line_2` varchar(512) NOT NULL,
  `billing_address_line_3` varchar(512) NOT NULL,
  `billing_address_line_4` varchar(256) NOT NULL,
  `billing_town` varchar(256) NOT NULL,
  `billing_county` varchar(25) NOT NULL,
  `billing_postcode` varchar(25) NOT NULL,
  `billing_country` varchar(25) NOT NULL,
  `is_archive` tinyint(4) NOT NULL DEFAULT 0,
  `archived_on` datetime DEFAULT NULL,
  `archived_by` int(11) DEFAULT NULL,
  `created_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_by` int(11) DEFAULT NULL,
  `updated_on` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_by` int(11) DEFAULT NULL,
  `action_type` varchar(255) NOT NULL,
  `history_created_by` int(11) NOT NULL,
  `history_created_on` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `comp_company_details_history`
--
ALTER TABLE `comp_company_details_history`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`),
  ADD KEY `company_name` (`company_name`),
  ADD KEY `is_archive` (`is_archive`),
  ADD KEY `his_id` (`his_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `comp_company_details_history`
--
ALTER TABLE `comp_company_details_history`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!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 */;
