-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.sql
155 lines (120 loc) · 5.12 KB
/
schema.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
# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: boxmeupapp.com (MySQL 5.1.41-3ubuntu12.10)
# Database: boxmeup
# Generation Time: 2013-08-06 01:00:34 +0000
# ************************************************************
/*!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 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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table api_users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `api_users`;
CREATE TABLE `api_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`api_key` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`secret_key` varchar(40) COLLATE utf8_unicode_ci DEFAULT '',
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `api_key` (`api_key`),
KEY `secret_key` (`secret_key`),
CONSTRAINT `fk_user_id_constraint` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table container_items
# ------------------------------------------------------------
DROP TABLE IF EXISTS `container_items`;
CREATE TABLE `container_items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`container_id` int(11) NOT NULL DEFAULT '0',
`uuid` varchar(36) DEFAULT NULL,
`body` varchar(100) DEFAULT NULL,
`quantity` int(11) NOT NULL DEFAULT '1',
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `container` (`container_id`),
KEY `fk_container_items_containers1` (`container_id`),
KEY `uuid` (`uuid`),
CONSTRAINT `fk_container_items_containers1` FOREIGN KEY (`container_id`) REFERENCES `containers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Items kept in containers';
# Dump of table containers
# ------------------------------------------------------------
DROP TABLE IF EXISTS `containers`;
CREATE TABLE `containers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`location_id` int(11) DEFAULT '0',
`uuid` varchar(36) DEFAULT NULL,
`name` varchar(36) DEFAULT NULL,
`slug` varchar(40) DEFAULT NULL,
`container_item_count` int(10) unsigned DEFAULT '0',
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user` (`user_id`),
KEY `fk_containers_users` (`user_id`),
KEY `location_id` (`location_id`),
CONSTRAINT `fk_containers_users` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Container objects reference head for container items';
# Dump of table locations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `locations`;
CREATE TABLE `locations` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`uuid` char(36) DEFAULT NULL,
`name` varchar(40) DEFAULT NULL,
`is_mappable` tinyint(1) NOT NULL DEFAULT '0',
`address` varchar(250) DEFAULT NULL,
`container_count` int(11) NOT NULL DEFAULT '0',
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
# Dump of table sphinx_counters
# ------------------------------------------------------------
DROP TABLE IF EXISTS `sphinx_counters`;
CREATE TABLE `sphinx_counters` (
`counter_id` int(11) NOT NULL,
`max_doc_id` int(11) NOT NULL,
PRIMARY KEY (`counter_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '',
`password` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '',
`uuid` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '',
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
`reset_password` tinyint(1) NOT NULL DEFAULT '0',
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
KEY `uuid` (`uuid`),
KEY `is_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_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 */;