-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `dailyrate`
--

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

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `username` varchar(32) NOT NULL,
  `session_id` char(64) NOT NULL,
  `user_agent` varchar(512) DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `expires_at` datetime NOT NULL,
  `last_seen` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` (`username`, `session_id`, `user_agent`, `ip_address`, `created_at`, `expires_at`, `last_seen`) VALUES
('rmitchell', '60fa6ee48199efc53843620898fca411ef7a08514adc596eba91db180d341845', NULL, NULL, '2025-07-22 17:17:22', '2025-07-22 17:47:33', '2025-07-22 17:17:33');

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

--
-- Table structure for table `skills`
--

CREATE TABLE `skills` (
  `id` int(11) NOT NULL,
  `skill_display_name` varchar(64) NOT NULL,
  `skill_reference` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `skills`
--

INSERT INTO `skills` (`id`, `skill_display_name`, `skill_reference`) VALUES
(1, 'Air Conditioning ', 'aircon'),
(2, 'Asbestos', 'asbestos');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(10) UNSIGNED NOT NULL,
  `email` varchar(255) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `username` varchar(32) NOT NULL,
  `attributes` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `email`, `password_hash`, `created_at`, `username`, `attributes`) VALUES
(1, 'r@r.com', '$2b$12$.Z08eVGLYKNntv5aYV.XwudeSgEJKqfFyp0sQxIFd6Wyz.MAxLsUe', '2025-07-18 18:07:42', 'rmitchell', '{\"fname\": \"Robin\", \"lname\": \"Mitchell\", \"post_code\": \"CV37 8FT\", \"avatar\": \"rmitchell\", \"skills\": \"{\\\"aircon\\\":true,\\\"asbestos\\\":true}\", \"account_type\": \"tradesman\", \"school_name\": \"My School\", \"school_location\": \"PO32\", \"driving_license\": \"true\", \"company_name\": \"MitchElectronics\", \"company_location\": \"CV32\", \"employers_insurance\": \"true\", \"bookings\": {\"27/07/2025\": {\"project_name\": \"\", \"project_description\": \"\", \"project_skills\": \"[\\\"aircon\\\",\\\"asbestos\\\"]\", \"project_location\": \"\", \"booking_user\": \"rmitchell\"}, \"28/07/2025\": {\"project_name\": \"\", \"project_description\": \"\", \"project_skills\": \"[\\\"aircon\\\",\\\"asbestos\\\"]\", \"project_location\": \"\", \"booking_user\": \"rmitchell\"}, \"29/07/2025\": {\"project_name\": \"\", \"project_description\": \"\", \"project_skills\": \"[\\\"aircon\\\",\\\"asbestos\\\"]\", \"project_location\": \"\", \"booking_user\": \"rmitchell\"}, \"30/07/2025\": {\"project_name\": \"All-IoT\", \"project_description\": \"A new house\", \"project_skills\": \"[\\\"aircon\\\"]\", \"project_location\": \"CV37 8FT\", \"booking_user\": \"rmitchell\"}, \"23/07/2025\": {\"project_name\": \"All-IoT\", \"project_description\": \"Test\", \"project_skills\": \"[\\\"aircon\\\"]\", \"project_location\": \"CV37 8FT\", \"booking_user\": \"rmitchell\"}, \"26/07/2025\": {\"project_name\": \"All-IoT\", \"project_description\": \"Test\", \"project_skills\": \"[\\\"aircon\\\"]\", \"project_location\": \"\", \"booking_user\": \"rmitchell\"}, \"22/07/2025\": {\"project_name\": \"\", \"project_description\": \"\", \"project_skills\": \"[\\\"aircon\\\"]\", \"project_location\": \"\", \"booking_user\": \"rmitchell\"}, \"31/07/2025\": {\"project_name\": \"\", \"project_description\": \"\", \"project_skills\": \"[\\\"aircon\\\"]\", \"project_location\": \"\", \"booking_user\": \"rmitchell\"}, \"24/07/2025\": {\"project_name\": \"\", \"project_description\": \"\", \"project_skills\": \"[\\\"aircon\\\"]\", \"project_location\": \"\", \"booking_user\": \"rmitchell\"}, \"25/07/2025\": {\"project_name\": \"\", \"project_description\": \"\", \"project_skills\": \"[\\\"asbestos\\\"]\", \"project_location\": \"\", \"booking_user\": \"rmitchell\"}}}');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`username`),
  ADD UNIQUE KEY `session_id` (`session_id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- Indexes for table `skills`
--
ALTER TABLE `skills`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `skill_display_name` (`skill_display_name`,`skill_reference`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `username` (`username`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `skills`
--
ALTER TABLE `skills`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
COMMIT;

