-
Notifications
You must be signed in to change notification settings - Fork 1
/
1410inventory.sql
193 lines (164 loc) · 5.34 KB
/
1410inventory.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 02, 2018 at 04:44 PM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `1410inventory`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(3) NOT NULL,
`first_name` varchar(25) NOT NULL,
`last_name` varchar(25) NOT NULL,
`email` varchar(255) NOT NULL,
`mobile1` varchar(15) NOT NULL,
`mobile2` varchar(15) NOT NULL,
`password` char(60) NOT NULL,
`role` char(5) NOT NULL,
`created_on` datetime NOT NULL,
`last_login` datetime NOT NULL,
`last_seen` datetime NOT NULL,
`last_edited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`account_status` char(1) NOT NULL DEFAULT '1',
`deleted` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `first_name`, `last_name`, `email`, `mobile1`, `mobile2`, `password`, `role`, `created_on`, `last_login`, `last_seen`, `last_edited`, `account_status`, `deleted`) VALUES
(1, 'Admin', 'Demo', '[email protected]', '08021111111', '07032222222', '$2y$10$xv9I14OlR36kPCjlTv.wEOX/6Dl7VMuWCl4vCxAVWP1JwYIaw4J2C', 'Super', '2017-01-04 22:19:16', '2018-05-18 16:47:21', '2018-05-18 17:28:09', '2018-05-18 16:28:09', '1', '0');
-- --------------------------------------------------------
--
-- Table structure for table `eventlog`
--
CREATE TABLE `eventlog` (
`id` bigint(20) UNSIGNED NOT NULL,
`event` varchar(200) NOT NULL,
`eventRowIdOrRef` varchar(20) DEFAULT NULL,
`eventDesc` text,
`eventTable` varchar(20) DEFAULT NULL,
`staffInCharge` bigint(20) UNSIGNED NOT NULL,
`eventTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `items`
--
CREATE TABLE `items` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(50) NOT NULL,
`code` varchar(50) NOT NULL,
`description` text,
`unitPrice` decimal(10,2) NOT NULL,
`quantity` int(6) NOT NULL,
`dateAdded` datetime NOT NULL,
`lastUpdated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `lk_sess`
--
CREATE TABLE `lk_sess` (
`id` varchar(40) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`timestamp` int(10) UNSIGNED NOT NULL DEFAULT '0',
`data` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `transactions`
--
CREATE TABLE `transactions` (
`transId` bigint(20) UNSIGNED NOT NULL,
`ref` varchar(10) NOT NULL,
`itemName` varchar(50) NOT NULL,
`itemCode` varchar(50) NOT NULL,
`description` text,
`quantity` int(6) NOT NULL,
`unitPrice` decimal(10,2) NOT NULL,
`totalPrice` decimal(10,2) NOT NULL,
`totalMoneySpent` decimal(10,2) NOT NULL,
`amountTendered` decimal(10,2) NOT NULL,
`discount_amount` decimal(10,2) NOT NULL,
`discount_percentage` decimal(10,2) NOT NULL,
`vatPercentage` decimal(10,2) NOT NULL,
`vatAmount` decimal(10,2) NOT NULL,
`changeDue` decimal(10,2) NOT NULL,
`modeOfPayment` varchar(20) NOT NULL,
`cust_name` varchar(20) DEFAULT NULL,
`cust_phone` varchar(15) DEFAULT NULL,
`cust_email` varchar(50) DEFAULT NULL,
`transType` char(1) NOT NULL,
`staffId` bigint(20) UNSIGNED NOT NULL,
`transDate` datetime NOT NULL,
`lastUpdated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`cancelled` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `mobile1` (`mobile1`);
--
-- Indexes for table `eventlog`
--
ALTER TABLE `eventlog`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `items`
--
ALTER TABLE `items`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`),
ADD UNIQUE KEY `code` (`code`);
--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
ADD PRIMARY KEY (`transId`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(3) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `eventlog`
--
ALTER TABLE `eventlog`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `items`
--
ALTER TABLE `items`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
MODIFY `transId` bigint(20) UNSIGNED 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 */;