|
| 1 | +-- phpMyAdmin SQL Dump |
| 2 | +-- version 5.2.1 |
| 3 | +-- https://www.phpmyadmin.net/ |
| 4 | +-- |
| 5 | +-- Host: 127.0.0.1 |
| 6 | +-- Generation Time: May 16, 2023 at 07:09 AM |
| 7 | +-- Server version: 10.4.28-MariaDB |
| 8 | +-- PHP Version: 8.0.28 |
| 9 | + |
| 10 | +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
| 11 | +START TRANSACTION; |
| 12 | +SET time_zone = "+00:00"; |
| 13 | + |
| 14 | + |
| 15 | +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
| 16 | +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
| 17 | +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
| 18 | +/*!40101 SET NAMES utf8mb4 */; |
| 19 | + |
| 20 | +-- |
| 21 | +-- Database: `db_hash` |
| 22 | +-- |
| 23 | + |
| 24 | +-- -------------------------------------------------------- |
| 25 | + |
| 26 | +-- |
| 27 | +-- Table structure for table `history` |
| 28 | +-- |
| 29 | + |
| 30 | +CREATE TABLE `history` ( |
| 31 | + `id` int(11) NOT NULL, |
| 32 | + `user_id` int(11) NOT NULL, |
| 33 | + `product_id` int(11) NOT NULL, |
| 34 | + `product_name` varchar(255) NOT NULL, |
| 35 | + `size` int(11) NOT NULL, |
| 36 | + `qty` int(11) NOT NULL, |
| 37 | + `price` int(11) NOT NULL, |
| 38 | + `status` varchar(255) NOT NULL, |
| 39 | + `created` datetime NOT NULL DEFAULT current_timestamp() |
| 40 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |
| 41 | + |
| 42 | +-- -------------------------------------------------------- |
| 43 | + |
| 44 | +-- |
| 45 | +-- Table structure for table `inventory` |
| 46 | +-- |
| 47 | + |
| 48 | +CREATE TABLE `inventory` ( |
| 49 | + `id` int(11) NOT NULL, |
| 50 | + `user_id` int(11) NOT NULL, |
| 51 | + `product_code` varchar(255) NOT NULL, |
| 52 | + `stock_in` int(11) NOT NULL, |
| 53 | + `stock_out` int(11) NOT NULL, |
| 54 | + `created` datetime NOT NULL |
| 55 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |
| 56 | + |
| 57 | +-- -------------------------------------------------------- |
| 58 | + |
| 59 | +-- |
| 60 | +-- Table structure for table `products` |
| 61 | +-- |
| 62 | + |
| 63 | +CREATE TABLE `products` ( |
| 64 | + `id` int(11) NOT NULL, |
| 65 | + `product_name` varchar(255) NOT NULL, |
| 66 | + `size` int(11) NOT NULL, |
| 67 | + `qty` int(11) NOT NULL, |
| 68 | + `price` int(11) NOT NULL, |
| 69 | + `created` datetime NOT NULL DEFAULT current_timestamp() |
| 70 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |
| 71 | + |
| 72 | +-- -------------------------------------------------------- |
| 73 | + |
| 74 | +-- |
| 75 | +-- Table structure for table `transaction` |
| 76 | +-- |
| 77 | + |
| 78 | +CREATE TABLE `transaction` ( |
| 79 | + `id` int(11) NOT NULL, |
| 80 | + `user_id` int(11) NOT NULL, |
| 81 | + `sales` int(11) NOT NULL, |
| 82 | + `amount` int(11) NOT NULL, |
| 83 | + `discounted_sales` int(11) NOT NULL, |
| 84 | + `created` datetime NOT NULL DEFAULT current_timestamp() |
| 85 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |
| 86 | + |
| 87 | +-- -------------------------------------------------------- |
| 88 | + |
| 89 | +-- |
| 90 | +-- Table structure for table `users` |
| 91 | +-- |
| 92 | + |
| 93 | +CREATE TABLE `users` ( |
| 94 | + `id` int(11) NOT NULL, |
| 95 | + `username` varchar(255) NOT NULL, |
| 96 | + `password` varchar(255) NOT NULL, |
| 97 | + `level` int(11) NOT NULL, |
| 98 | + `created` datetime NOT NULL DEFAULT current_timestamp() |
| 99 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |
| 100 | + |
| 101 | +-- -------------------------------------------------------- |
| 102 | + |
| 103 | +-- |
| 104 | +-- Table structure for table `user_logs` |
| 105 | +-- |
| 106 | + |
| 107 | +CREATE TABLE `user_logs` ( |
| 108 | + `id` int(11) NOT NULL, |
| 109 | + `username` varchar(255) NOT NULL, |
| 110 | + `type` varchar(255) NOT NULL, |
| 111 | + `sign_in` datetime NOT NULL, |
| 112 | + `sign_out` datetime NOT NULL, |
| 113 | + `created` datetime NOT NULL |
| 114 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |
| 115 | + |
| 116 | +-- |
| 117 | +-- Indexes for dumped tables |
| 118 | +-- |
| 119 | + |
| 120 | +-- |
| 121 | +-- Indexes for table `history` |
| 122 | +-- |
| 123 | +ALTER TABLE `history` |
| 124 | + ADD PRIMARY KEY (`id`), |
| 125 | + ADD KEY `product_id` (`product_id`); |
| 126 | + |
| 127 | +-- |
| 128 | +-- Indexes for table `inventory` |
| 129 | +-- |
| 130 | +ALTER TABLE `inventory` |
| 131 | + ADD PRIMARY KEY (`id`); |
| 132 | + |
| 133 | +-- |
| 134 | +-- Indexes for table `products` |
| 135 | +-- |
| 136 | +ALTER TABLE `products` |
| 137 | + ADD PRIMARY KEY (`id`); |
| 138 | + |
| 139 | +-- |
| 140 | +-- Indexes for table `transaction` |
| 141 | +-- |
| 142 | +ALTER TABLE `transaction` |
| 143 | + ADD PRIMARY KEY (`id`), |
| 144 | + ADD KEY `user_id` (`user_id`); |
| 145 | + |
| 146 | +-- |
| 147 | +-- Indexes for table `users` |
| 148 | +-- |
| 149 | +ALTER TABLE `users` |
| 150 | + ADD PRIMARY KEY (`id`); |
| 151 | + |
| 152 | +-- |
| 153 | +-- Indexes for table `user_logs` |
| 154 | +-- |
| 155 | +ALTER TABLE `user_logs` |
| 156 | + ADD PRIMARY KEY (`id`); |
| 157 | + |
| 158 | +-- |
| 159 | +-- AUTO_INCREMENT for dumped tables |
| 160 | +-- |
| 161 | + |
| 162 | +-- |
| 163 | +-- AUTO_INCREMENT for table `history` |
| 164 | +-- |
| 165 | +ALTER TABLE `history` |
| 166 | + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; |
| 167 | + |
| 168 | +-- |
| 169 | +-- AUTO_INCREMENT for table `inventory` |
| 170 | +-- |
| 171 | +ALTER TABLE `inventory` |
| 172 | + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; |
| 173 | + |
| 174 | +-- |
| 175 | +-- AUTO_INCREMENT for table `products` |
| 176 | +-- |
| 177 | +ALTER TABLE `products` |
| 178 | + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; |
| 179 | + |
| 180 | +-- |
| 181 | +-- AUTO_INCREMENT for table `transaction` |
| 182 | +-- |
| 183 | +ALTER TABLE `transaction` |
| 184 | + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; |
| 185 | + |
| 186 | +-- |
| 187 | +-- AUTO_INCREMENT for table `users` |
| 188 | +-- |
| 189 | +ALTER TABLE `users` |
| 190 | + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; |
| 191 | + |
| 192 | +-- |
| 193 | +-- AUTO_INCREMENT for table `user_logs` |
| 194 | +-- |
| 195 | +ALTER TABLE `user_logs` |
| 196 | + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; |
| 197 | + |
| 198 | +-- |
| 199 | +-- Constraints for dumped tables |
| 200 | +-- |
| 201 | + |
| 202 | +-- |
| 203 | +-- Constraints for table `history` |
| 204 | +-- |
| 205 | +ALTER TABLE `history` |
| 206 | + ADD CONSTRAINT `history_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`); |
| 207 | + |
| 208 | +-- |
| 209 | +-- Constraints for table `transaction` |
| 210 | +-- |
| 211 | +ALTER TABLE `transaction` |
| 212 | + ADD CONSTRAINT `transaction_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); |
| 213 | +COMMIT; |
| 214 | + |
| 215 | +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
| 216 | +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; |
| 217 | +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
0 commit comments