-
Notifications
You must be signed in to change notification settings - Fork 117
/
economizzer.sql
278 lines (243 loc) · 10.6 KB
/
economizzer.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: localhost Database: economizzer
-- ------------------------------------------------------
-- Server version 5.7.31
/*!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 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `category`
--
DROP TABLE IF EXISTS `category`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `category` (
`id_category` int(11) NOT NULL AUTO_INCREMENT,
`parent_id` int(11) DEFAULT NULL,
`desc_category` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`hexcolor_category` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '#2c3e50',
`is_active` int(1) NOT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id_category`),
KEY `fk_tb_category_tb_user1_idx` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4742 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Categories of entries: Water, light, card, etc.';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `category`
--
LOCK TABLES `category` WRITE;
/*!40000 ALTER TABLE `category` DISABLE KEYS */;
INSERT INTO `category` VALUES (4722,NULL,'Personal','#93c47d',1,3),(4725,NULL,'Business','#6fa8dc',1,3),(4726,4722,'Family','#93c47d',1,3),(4727,4725,'Internet','#c27ba0',1,3),(4728,NULL,'teste1','',1,3),(4729,NULL,'teste2','',1,3),(4730,4728,'teste1.2','',1,3),(4731,4728,'teste1.1','',1,3);
/*!40000 ALTER TABLE `category` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `role`
--
DROP TABLE IF EXISTS `role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`create_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL,
`can_admin` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `role`
--
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
INSERT INTO `role` VALUES (1,'Admin','2015-01-25 04:53:11',NULL,1),(2,'User','2015-01-25 04:53:11',NULL,0);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_key`
--
DROP TABLE IF EXISTS `user_key`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_key` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`type` smallint(6) NOT NULL,
`key_value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`create_time` timestamp NULL DEFAULT NULL,
`consume_time` timestamp NULL DEFAULT NULL,
`expire_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tb_user_key_key` (`key_value`) USING BTREE,
KEY `tb_user_key_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3079 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_key`
--
LOCK TABLES `user_key` WRITE;
/*!40000 ALTER TABLE `user_key` DISABLE KEYS */;
INSERT INTO `user_key` VALUES (1,3,1,'fgX4vB8x1UW8uGdCaKQTj9kKo7Kfbltp','2015-02-14 05:03:28',NULL,NULL),(3,3,2,'jkApCoj4zQ1osBGZ6gEwIJ9zgLeiOFxb','2015-04-21 22:15:00',NULL,'2015-10-09 20:05:45');
/*!40000 ALTER TABLE `user_key` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `cashbook`
--
DROP TABLE IF EXISTS `cashbook`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cashbook` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`value` float NOT NULL,
`description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`date` date NOT NULL,
`is_pending` tinyint(1) NOT NULL DEFAULT '0',
`attachment` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`inc_datetime` datetime DEFAULT NULL COMMENT 'insert date',
`edit_datetime` datetime DEFAULT NULL COMMENT 'edit date',
`user_id` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`type_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk_tb_cashbook_tb_user1_idx` (`user_id`),
KEY `fk_tb_cashbook_tb_category1_idx` (`category_id`),
KEY `fk_tb_cashbook_tb_type1_idx` (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Control financial movement';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cashbook`
--
LOCK TABLES `cashbook` WRITE;
/*!40000 ALTER TABLE `cashbook` DISABLE KEYS */;
/*!40000 ALTER TABLE `cashbook` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `type`
--
DROP TABLE IF EXISTS `type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `type` (
`id_type` int(11) NOT NULL AUTO_INCREMENT,
`desc_type` varchar(45) CHARACTER SET latin1 NOT NULL,
`hexcolor_type` varchar(45) CHARACTER SET latin1 DEFAULT NULL,
`icon_type` varchar(45) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`id_type`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Movement Type: Debit, Credit';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `type`
--
LOCK TABLES `type` WRITE;
/*!40000 ALTER TABLE `type` DISABLE KEYS */;
INSERT INTO `type` VALUES (1,'Revenue','#18bc9c',''),(2,'Expense','#e74c3c','');
/*!40000 ALTER TABLE `type` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`role_id` int(11) NOT NULL,
`status` smallint(6) NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`new_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`auth_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`api_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`login_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`login_time` timestamp NULL DEFAULT NULL,
`create_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`create_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL,
`ban_time` timestamp NULL DEFAULT NULL,
`ban_reason` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tb_user_email` (`email`) USING BTREE,
UNIQUE KEY `tb_user_username` (`username`) USING BTREE,
KEY `tb_user_role_id` (`role_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3654 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user`
--
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (3,2,1,'[email protected]',NULL,'joe','$2y$13$vLlDZIbLVW4G0/.lE9Ak9uEPsw0qjzbG8tcnVXvTzRqOTNTe1Nmkm','qA_US4c8xUCucUDWXyYC-SA1qcxCiGTV','GWQuKuPFhAJTjE8GL5w2tvaveKs1Bvno','::1','2023-04-20 00:35:34','127.0.0.1','2015-02-14 05:03:28','2019-10-06 21:37:10',NULL,NULL);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_auth`
--
DROP TABLE IF EXISTS `user_auth`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_auth` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`provider` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`provider_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`provider_attributes` text COLLATE utf8_unicode_ci NOT NULL,
`create_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tb_user_auth_provider_id` (`provider_id`) USING BTREE,
KEY `tb_user_auth_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=730 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_auth`
--
LOCK TABLES `user_auth` WRITE;
/*!40000 ALTER TABLE `user_auth` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_auth` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `profile`
--
DROP TABLE IF EXISTS `profile`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `profile` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`create_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL,
`full_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`language` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'en',
`startpage` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'dashboard/index',
`currencycode` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'USD',
`decimalseparator` varchar(1) COLLATE utf8_unicode_ci NOT NULL DEFAULT '.',
PRIMARY KEY (`id`),
KEY `tb_profile_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3654 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `profile`
--
LOCK TABLES `profile` WRITE;
/*!40000 ALTER TABLE `profile` DISABLE KEYS */;
INSERT INTO `profile` VALUES (3,3,'2015-02-14 05:03:28','2021-05-09 10:41:23','joe','en','cashbook/index','USD',',');
/*!40000 ALTER TABLE `profile` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2023-04-19 19:38:36