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

START TRANSACTION;



--
-- Database: `overthrow`
--

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

--
-- Table structure for table `accounts`
--

CREATE TABLE `accounts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `email` varchar(255) NOT NULL,
  `username` varchar(32) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `last_login_at` datetime DEFAULT NULL,
  `is_banned` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accounts`
--

INSERT INTO `accounts` (`id`, `email`, `username`, `password_hash`, `created_at`, `last_login_at`, `is_banned`) VALUES
(1, 'test@example.com', 'testuser', '$2y$10$N21kHVCx4/pzROTuUgGIJeOjsqgA8PNs4LkfCv6S3hcZPc7gpitYa', '2026-06-17 15:48:58', NULL, 0),
(2, 'unitytest2@example.com', 'unitytest2', '$2y$10$CuPTdRnAeovVvEvj3tBzbeMT41bBZ5mRXvrD7u5GUX.DqdFstqDd2', '2026-06-17 23:13:08', NULL, 0);

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

--
-- Table structure for table `account_sessions`
--

CREATE TABLE `account_sessions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `account_id` bigint(20) UNSIGNED NOT NULL,
  `token_hash` char(64) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `expires_at` datetime NOT NULL,
  `revoked_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_sessions`
--

INSERT INTO `account_sessions` (`id`, `account_id`, `token_hash`, `created_at`, `expires_at`, `revoked_at`) VALUES
(1, 1, '8302637d3dec0ddce8fcf0661d44158d9ceb5e5cb4c2df6068a0b0b7ad652133', '2026-06-17 15:53:27', '2026-07-17 16:53:27', NULL),
(2, 1, '040d1b9a3a01e1cb300f08f8132b14da262a383922309587ccaf989894c44e1a', '2026-06-17 15:56:02', '2026-07-17 16:56:02', NULL),
(3, 1, '538860f9747fdc26fbda854ef3f24bb343e1645cc1c4f0fdc4d27ccae07f0ecd', '2026-06-17 15:58:11', '2026-07-17 16:58:11', NULL),
(4, 1, 'd06699ff1eef81e8bbf3a73f1b74acc42ae277b9f3c8ed18e488c90d6ffd4129', '2026-06-17 15:58:22', '2026-07-17 16:58:22', NULL),
(5, 1, '8604452f74d291086dd48e64e719ee00582b5aa819e917b4500273a50bd40346', '2026-06-17 22:17:31', '2026-07-17 23:17:31', NULL),
(6, 1, '0ea5c5a4f973d45d37131d9bdec77057fd78f8b58b1c8f9ab655ffe52a8c3e63', '2026-06-17 22:20:34', '2026-07-17 23:20:34', NULL),
(7, 1, 'ee693bbb135fa637c6b17e10007ba75a293a3173b8f05d8b786a2795edc02162', '2026-06-17 23:21:43', '2026-07-18 00:21:43', NULL),
(8, 1, 'f265fa6c65589fd829c8280291bb9b31fdd0b932b9b85622172cd76c45ce8a12', '2026-06-17 23:26:33', '2026-07-18 00:26:33', NULL),
(9, 1, '29cacf2fa442e2b67da0d347baeda7714edcead0742a08f5069af54d7bc8a215', '2026-06-17 23:32:37', '2026-07-18 00:32:37', NULL),
(10, 1, 'ce72a722022c46bedfa48386bad932f3efd9b8c609cf3090dceec8f38b1c2601', '2026-06-18 00:19:09', '2026-07-18 01:19:09', NULL),
(11, 1, 'ceabd352b00b767984f0e2775bb354f7e401768014985a9ce4586c03e3898612', '2026-06-18 00:23:48', '2026-07-18 01:23:48', NULL),
(12, 1, 'a2ad8de54a679e6cfa24911d2e00d3605a5005052d6f32632a2dfb86a4b5d89c', '2026-06-18 00:25:51', '2026-07-18 01:25:51', NULL),
(13, 1, '3e180a6b38379379380fade324bb2d9c3e5b9c5eb1b06b6a6b76c4f040cf4295', '2026-06-18 00:27:24', '2026-07-18 01:27:24', NULL),
(14, 1, '7c219d59ab5ae5c0faa5a2cf99f947de9550633af46b54c0d495ac88076b8dc8', '2026-06-18 00:31:08', '2026-07-18 01:31:08', NULL),
(15, 1, 'edf236cb6434b0116aca02df724aa5b641a9ab4cf76a812270e1a415005da9b2', '2026-06-18 00:36:58', '2026-07-18 01:36:58', NULL),
(16, 1, '7c1e2afc07daea7cbd7938f9e5e2f2f6cbcb2a3a0774110757f1d88865e58f57', '2026-06-18 00:39:46', '2026-07-18 01:39:46', NULL),
(17, 1, 'b557461fdf1c13940b8e1a7e2a28e7a78540edf23f9e7ddbe117a7924a66e458', '2026-06-18 00:40:09', '2026-07-18 01:40:09', NULL),
(18, 1, '9cc69218953689fa9653ea00ce13ebbba1655610abe1c069e99e309b697783f1', '2026-06-18 00:40:54', '2026-07-18 01:40:54', NULL),
(19, 1, 'a742efde4514691b6bd76f0c5c1df7d37b291e325496b5b2d6cba2cf0aa742a7', '2026-06-18 00:45:08', '2026-07-18 01:45:08', NULL),
(20, 1, '6cb61fc0ed4f9fdd3934436aed7f3e4cdcb0cf426aeab3a9589340a659686f8c', '2026-06-18 00:46:52', '2026-07-18 01:46:52', NULL),
(21, 1, '42980a4457cb11929c3f1600a900a5848f429fd4fa6cb2689d06977ccbebc6ef', '2026-06-18 00:51:16', '2026-07-18 01:51:16', NULL),
(22, 1, '35191c70a8c380d48ed432f78819519850996e98fddfbb48b5463c52b919ed43', '2026-06-18 00:55:33', '2026-07-18 01:55:33', NULL),
(23, 1, 'f18aa628862cc4422816f538c1cf573b8f4168436217237d18407be3fbe5c62c', '2026-06-18 00:56:20', '2026-07-18 01:56:20', NULL),
(24, 1, 'e4b6b30afd70da1cf19a1b40551c911b6d90e2f3c3bff23a5dca5202b69b6b98', '2026-06-18 00:59:49', '2026-07-18 01:59:49', NULL),
(25, 1, '12d8aa334cc7b746c281aae25911ae4cf85e8ae6613cacc91c213dac8af574a7', '2026-06-18 01:01:26', '2026-07-18 02:01:26', NULL),
(26, 1, '1657ef5cd7cbe6b40a93231ee562b30a0d3a909d017b388fa452f682c9c9fc6f', '2026-06-18 01:05:41', '2026-07-18 02:05:41', NULL),
(27, 1, '4ee07ceb390426f22f2763a3e55506f6dac42387f30350d060a0329a7b87fb59', '2026-06-18 01:07:49', '2026-07-18 02:07:49', NULL),
(28, 1, 'c1380c104e523289cfb6e7fd67583912f3ac93b1a02dac378ed2ba3b46a14601', '2026-06-18 01:09:23', '2026-07-18 02:09:23', NULL),
(29, 1, '601230235edd52b33a0c4e07bb114ef7355aed1ffc93a9b1f896aa97049b380f', '2026-06-19 00:33:44', '2026-07-19 01:33:44', NULL),
(30, 1, '16a20e377d5ea0744617ff372c109c0168dfbe7fd4140240a532c388edc85924', '2026-06-19 00:58:06', '2026-07-19 01:58:06', NULL),
(31, 1, '110ddcc96a4c68ab265ad8bf56676df18d86a6a41091cb4c30f041265386c289', '2026-06-19 01:01:34', '2026-07-19 02:01:34', NULL),
(32, 1, '5a70b02fafa8f0c9c1e16c7285349f166edc68a8d42f633ecc77d41c5fd7ceca', '2026-06-19 01:08:09', '2026-07-19 02:08:09', NULL),
(33, 1, '022a100556975e8684bfbed4baeda44e620e362bf2a00d77791ec787a00922d6', '2026-06-19 01:09:26', '2026-07-19 02:09:26', NULL),
(34, 1, 'a7de96e03fdb385bfa79f2e83d2e6cd22c53ed88db1d0d71ab0cae993f62e0e9', '2026-06-19 01:10:49', '2026-07-19 02:10:49', NULL),
(35, 1, '566b6c8ac7264fb38c2594ec0afd6fb5cbc200de4f55908b3d72434a34af6fd8', '2026-06-19 01:11:24', '2026-07-19 02:11:24', NULL),
(36, 1, 'fcadd0521202069b47f7ed4815e75ded995942baf7ceea00f08e4e7879352218', '2026-06-19 01:13:17', '2026-07-19 02:13:17', NULL),
(37, 1, 'dcfa9c2a04e4fd6021344e9cbe1198e05072e51d4f54b9c9836e69ad5e488e87', '2026-06-19 01:14:56', '2026-07-19 02:14:56', NULL),
(38, 1, '7dd173afa17a6fa5b03c807111750b2104955cd3fb9d1e81db2ce52587ccbc51', '2026-06-19 01:17:18', '2026-07-19 02:17:18', NULL),
(39, 1, '51dcedd5382233f0c6af799e920368d95cb108b017e4955b4308f4cab148906d', '2026-06-19 01:19:12', '2026-07-19 02:19:12', NULL),
(40, 1, '185d4523b4d228bb49a835a76f97abe83b7d398b2b9c5df4057877e9696df329', '2026-06-19 01:20:21', '2026-07-19 02:20:21', NULL),
(41, 1, '33fc5ac32603a83be6e2a98cd59f9cc07581ad06d672fecb2e822781864b8adb', '2026-06-19 01:24:10', '2026-07-19 02:24:10', NULL),
(42, 1, '0354e0c476ab50546f56fc917652064b7ded4bd1e04ace555cde860ebbac2f50', '2026-06-19 01:27:05', '2026-07-19 02:27:05', NULL),
(43, 1, 'bc669b70871ee54db357bc7cf205d9fb739797cf11d3b2eefeeb140e3ad9789b', '2026-06-19 01:30:17', '2026-07-19 02:30:17', NULL),
(44, 1, '2879b42fc90ade8ce94a63c847e35a39714d93afae5e969d9589b0ac1e5e9a45', '2026-06-19 01:32:23', '2026-07-19 02:32:23', NULL),
(45, 1, 'e074863e9daf7433e1c13d279ffeea6fefa7cde72c2045dbaee077e7c7fab7ce', '2026-06-19 01:36:42', '2026-07-19 02:36:42', NULL),
(46, 1, '244cfe5cdd03495f9f3e1f4a54b50cd5f13c4b5149848c7a45e00405c46e0a20', '2026-06-19 01:40:59', '2026-07-19 02:40:59', NULL),
(47, 1, '174a557ffd225649bda2c6fa72d1675c1330a25b6091a1ea5173940559d8d322', '2026-06-19 01:42:32', '2026-07-19 02:42:32', NULL),
(48, 1, '0d3bf82f943179c15846a53e88c13b98b9494e50739ef3291040e585f2b4a99c', '2026-06-19 01:45:39', '2026-07-19 02:45:39', NULL),
(49, 1, '6a9c48581dd2733232c2c374b00fd2be4ec2fabff63a919bee66a179ee2ca5bb', '2026-06-19 01:46:11', '2026-07-19 02:46:11', NULL),
(50, 1, 'dbdfd6bdb18e6cbddcaa6636c77e6ce07c62c970e4fcc21a9392ac88b5c20253', '2026-06-19 01:46:57', '2026-07-19 02:46:57', NULL),
(51, 1, '6bb15cb8042de9f905b45c898bc7fdb0dcd62b5c5f170648f8db17f3a7a6e740', '2026-06-19 21:33:53', '2026-07-19 22:33:53', NULL),
(52, 1, '92beb0b1ed3c2fb1f1c13deeac7bce2a8bfb4ba7bd79aa4d8c250acfecd803a0', '2026-06-19 21:36:56', '2026-07-19 22:36:56', NULL),
(53, 1, '3454205a23376cae7f3103b28850fb5a598d1c12025300287b7d100d40d180c4', '2026-06-19 22:20:52', '2026-07-19 23:20:52', NULL),
(54, 1, '2ba057a8334e84296fc799a33b8eac262a81a40885ce16e4122a110abe6b60e0', '2026-06-19 22:22:28', '2026-07-19 23:22:28', NULL),
(55, 1, '45dbe0c307cf956089620c2b3c742c17c80633f86ec1a0919babd10d98dc6fc7', '2026-06-19 22:22:42', '2026-07-19 23:22:42', NULL);

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

--
-- Table structure for table `characters`
--

CREATE TABLE `characters` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `account_id` bigint(20) UNSIGNED NOT NULL,
  `character_name` varchar(32) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `last_played_at` datetime DEFAULT NULL,
  `level` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `experience` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
  `position_x` float NOT NULL DEFAULT 0,
  `position_y` float NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `characters`
--

INSERT INTO `characters` (`id`, `account_id`, `character_name`, `created_at`, `last_played_at`, `level`, `experience`, `position_x`, `position_y`) VALUES
(1, 1, 'TestChar', '2026-06-17 15:48:58', NULL, 1, 0, 10, 10),
(2, 2, 'Unity Tester', '2026-06-17 23:13:08', NULL, 1, 0, 0, 0);

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

--
-- Table structure for table `character_skills`
--

CREATE TABLE `character_skills` (
  `character_id` bigint(20) UNSIGNED NOT NULL,
  `skill_id` int(10) UNSIGNED NOT NULL,
  `level` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `experience` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `character_skills`
--

INSERT INTO `character_skills` (`character_id`, `skill_id`, `level`, `experience`, `updated_at`) VALUES
(1, 1, 1, 0, '2026-06-17 15:48:58'),
(1, 2, 1, 0, '2026-06-17 15:48:58'),
(1, 3, 1, 0, '2026-06-17 15:48:58'),
(1, 4, 1, 0, '2026-06-17 15:48:58'),
(1, 5, 1, 0, '2026-06-17 15:48:58'),
(1, 6, 1, 0, '2026-06-17 15:48:58'),
(2, 1, 1, 0, '2026-06-17 23:13:08'),
(2, 2, 1, 0, '2026-06-17 23:13:08'),
(2, 3, 1, 0, '2026-06-17 23:13:08'),
(2, 4, 1, 0, '2026-06-17 23:13:08'),
(2, 5, 1, 0, '2026-06-17 23:13:08'),
(2, 6, 1, 0, '2026-06-17 23:13:08');

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

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

CREATE TABLE `skills` (
  `id` int(10) UNSIGNED NOT NULL,
  `skill_key` varchar(50) NOT NULL,
  `display_name` varchar(50) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `skills` (`id`, `skill_key`, `display_name`, `created_at`) VALUES
(1, 'melee', 'Melee', '2026-06-17 15:30:01'),
(2, 'ranged', 'Ranged', '2026-06-17 15:30:01'),
(3, 'defence', 'Defence', '2026-06-17 15:30:01'),
(4, 'mining', 'Mining', '2026-06-17 15:30:01'),
(5, 'woodcutting', 'Woodcutting', '2026-06-17 15:30:01'),
(6, 'fishing', 'Fishing', '2026-06-17 15:30:01');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `account_sessions`
--
ALTER TABLE `account_sessions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_account_sessions_token_hash` (`token_hash`),
  ADD KEY `idx_account_sessions_account_id` (`account_id`),
  ADD KEY `idx_account_sessions_expires_at` (`expires_at`);

--
-- Indexes for table `characters`
--
ALTER TABLE `characters`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_characters_name` (`character_name`),
  ADD KEY `idx_characters_account_id` (`account_id`);

--
-- Indexes for table `character_skills`
--
ALTER TABLE `character_skills`
  ADD PRIMARY KEY (`character_id`,`skill_id`),
  ADD KEY `fk_character_skills_skill` (`skill_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `accounts`
--
ALTER TABLE `accounts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `account_sessions`
--
ALTER TABLE `account_sessions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;

--
-- AUTO_INCREMENT for table `characters`
--
ALTER TABLE `characters`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `skills`
--
ALTER TABLE `skills`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `account_sessions`
--
ALTER TABLE `account_sessions`
  ADD CONSTRAINT `fk_account_sessions_account` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `characters`
--
ALTER TABLE `characters`
  ADD CONSTRAINT `fk_characters_account` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `character_skills`
--
ALTER TABLE `character_skills`
  ADD CONSTRAINT `fk_character_skills_character` FOREIGN KEY (`character_id`) REFERENCES `characters` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_character_skills_skill` FOREIGN KEY (`skill_id`) REFERENCES `skills` (`id`) ON DELETE CASCADE;
COMMIT;

