forked from jmslagle/novabot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
create-db.sql
86 lines (78 loc) · 3.54 KB
/
create-db.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
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.2.9-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!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' */;
-- Dumping structure for table novabot.geocoding
CREATE TABLE IF NOT EXISTS `geocoding` (
`lat` double NOT NULL,
`lon` double NOT NULL,
`suburb` varchar(30) DEFAULT NULL,
`street_num` varchar(15) DEFAULT NULL,
`street` varchar(100) DEFAULT NULL,
`state` varchar(30) DEFAULT NULL,
`postal` varchar(15) DEFAULT NULL,
`neighbourhood` varchar(50) DEFAULT NULL,
`sublocality` varchar(50) DEFAULT NULL,
`country` varchar(50) DEFAULT NULL,
PRIMARY KEY (`lat`,`lon`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Data exporting was unselected.
-- Dumping structure for table novabot.pokemon
CREATE TABLE IF NOT EXISTS `pokemon` (
`user_id` varchar(50) DEFAULT NULL,
`id` varchar(30) DEFAULT NULL,
`max_iv` float DEFAULT 100,
`min_iv` float DEFAULT 0,
`location` varchar(30) DEFAULT NULL,
UNIQUE KEY `pokemon_user_id_id_channel_max_iv_min_iv_pk` (`user_id`,`id`,`location`,`max_iv`,`min_iv`),
CONSTRAINT `pokemon_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Data exporting was unselected.
-- Dumping structure for table novabot.preset
CREATE TABLE IF NOT EXISTS `preset` (
`user_id` varchar(50) NOT NULL,
`preset_name` varchar(50) NOT NULL,
`location` varchar(50) NOT NULL,
PRIMARY KEY (`user_id`,`preset_name`,`location`),
CONSTRAINT `preset_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Data exporting was unselected.
-- Dumping structure for table novabot.raid
CREATE TABLE IF NOT EXISTS `raid` (
`user_id` varchar(50) NOT NULL,
`boss_id` int(11) NOT NULL,
`location` varchar(30) NOT NULL,
PRIMARY KEY (`user_id`,`boss_id`,`location`),
CONSTRAINT `raid_users_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Data exporting was unselected.
-- Dumping structure for table novabot.raidlobby
CREATE TABLE IF NOT EXISTS `raidlobby` (
`lobby_id` int(11) NOT NULL,
`gym_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`members` int(11) DEFAULT 0,
`role_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`channel_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`next_timeleft_update` int(11) DEFAULT NULL,
`invite_code` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`lobby_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Data exporting was unselected.
-- Dumping structure for table novabot.users
CREATE TABLE IF NOT EXISTS `users` (
`id` varchar(50) NOT NULL,
`joindate` timestamp NOT NULL DEFAULT current_timestamp(),
`paused` tinyint(1) DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `users_id_uindex` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Data exporting was unselected.
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;