· 6 years ago · May 03, 2019, 08:30 PM
1-- MySQL dump 10.13 Distrib 5.7.25, for Linux (x86_64)
2--
3-- Host: localhost Database: dandori_production
4-- ------------------------------------------------------
5-- Server version 5.7.25-0ubuntu0.18.04.2
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Table structure for table `addresses`
20--
21
22DROP TABLE IF EXISTS `addresses`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `addresses` (
26 `id` int(11) NOT NULL AUTO_INCREMENT,
27 `zipcode` varchar(255) DEFAULT NULL,
28 `road_name` varchar(255) DEFAULT NULL,
29 `detail` varchar(255) DEFAULT NULL,
30 `phone` varchar(255) DEFAULT NULL,
31 `note` varchar(255) DEFAULT NULL,
32 `user_id` int(11) DEFAULT NULL,
33 `created_at` datetime NOT NULL,
34 `updated_at` datetime NOT NULL,
35 PRIMARY KEY (`id`),
36 KEY `index_addresses_on_user_id` (`user_id`)
37) ENGINE=InnoDB AUTO_INCREMENT=293 DEFAULT CHARSET=utf8;
38/*!40101 SET character_set_client = @saved_cs_client */;
39
40--
41-- Table structure for table `ar_internal_metadata`
42--
43
44DROP TABLE IF EXISTS `ar_internal_metadata`;
45/*!40101 SET @saved_cs_client = @@character_set_client */;
46/*!40101 SET character_set_client = utf8 */;
47CREATE TABLE `ar_internal_metadata` (
48 `key` varchar(255) NOT NULL,
49 `value` varchar(255) DEFAULT NULL,
50 `created_at` datetime NOT NULL,
51 `updated_at` datetime NOT NULL,
52 PRIMARY KEY (`key`)
53) ENGINE=InnoDB DEFAULT CHARSET=utf8;
54/*!40101 SET character_set_client = @saved_cs_client */;
55
56--
57-- Table structure for table `associate_teams`
58--
59
60DROP TABLE IF EXISTS `associate_teams`;
61/*!40101 SET @saved_cs_client = @@character_set_client */;
62/*!40101 SET character_set_client = utf8 */;
63CREATE TABLE `associate_teams` (
64 `id` int(11) NOT NULL AUTO_INCREMENT,
65 `team_id` int(11) DEFAULT NULL,
66 `staff_id` int(11) DEFAULT NULL,
67 `created_at` datetime NOT NULL,
68 `updated_at` datetime NOT NULL,
69 PRIMARY KEY (`id`),
70 KEY `index_associate_teams_on_team_id` (`team_id`),
71 KEY `index_associate_teams_on_staff_id` (`staff_id`),
72 CONSTRAINT `fk_rails_82d0c6152e` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`),
73 CONSTRAINT `fk_rails_a9ca5ac0c3` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`)
74) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8;
75/*!40101 SET character_set_client = @saved_cs_client */;
76
77--
78-- Table structure for table `bespoke_orders`
79--
80
81DROP TABLE IF EXISTS `bespoke_orders`;
82/*!40101 SET @saved_cs_client = @@character_set_client */;
83/*!40101 SET character_set_client = utf8 */;
84CREATE TABLE `bespoke_orders` (
85 `id` int(11) NOT NULL AUTO_INCREMENT,
86 `user_id` int(11) DEFAULT NULL,
87 `product_id` int(11) DEFAULT NULL,
88 `bespoke_order_guid` varchar(255) DEFAULT NULL,
89 `created_at` datetime NOT NULL,
90 `updated_at` datetime NOT NULL,
91 PRIMARY KEY (`id`),
92 KEY `index_bespoke_orders_on_user_id` (`user_id`),
93 KEY `index_bespoke_orders_on_product_id` (`product_id`),
94 CONSTRAINT `fk_rails_5ae3add1e5` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
95 CONSTRAINT `fk_rails_a099871cfe` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
96) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
97/*!40101 SET character_set_client = @saved_cs_client */;
98
99--
100-- Table structure for table `bespoke_orders_orders`
101--
102
103DROP TABLE IF EXISTS `bespoke_orders_orders`;
104/*!40101 SET @saved_cs_client = @@character_set_client */;
105/*!40101 SET character_set_client = utf8 */;
106CREATE TABLE `bespoke_orders_orders` (
107 `id` int(11) NOT NULL AUTO_INCREMENT,
108 `order_id` int(11) DEFAULT NULL,
109 `bespoke_order_id` int(11) DEFAULT NULL,
110 PRIMARY KEY (`id`),
111 KEY `index_bespoke_orders_orders_on_order_id` (`order_id`),
112 KEY `index_bespoke_orders_orders_on_bespoke_order_id` (`bespoke_order_id`)
113) ENGINE=InnoDB DEFAULT CHARSET=utf8;
114/*!40101 SET character_set_client = @saved_cs_client */;
115
116--
117-- Table structure for table `body_shapes`
118--
119
120DROP TABLE IF EXISTS `body_shapes`;
121/*!40101 SET @saved_cs_client = @@character_set_client */;
122/*!40101 SET character_set_client = utf8 */;
123CREATE TABLE `body_shapes` (
124 `id` int(11) NOT NULL AUTO_INCREMENT,
125 `user_id` int(11) DEFAULT NULL,
126 `custom_fields` json DEFAULT NULL,
127 `created_at` datetime NOT NULL,
128 `updated_at` datetime NOT NULL,
129 PRIMARY KEY (`id`),
130 KEY `index_body_shapes_on_user_id` (`user_id`) USING BTREE,
131 CONSTRAINT `fk_rails_bd7aab7f5a` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
132) ENGINE=InnoDB AUTO_INCREMENT=581 DEFAULT CHARSET=utf8;
133/*!40101 SET character_set_client = @saved_cs_client */;
134
135--
136-- Table structure for table `calendar_events`
137--
138
139DROP TABLE IF EXISTS `calendar_events`;
140/*!40101 SET @saved_cs_client = @@character_set_client */;
141/*!40101 SET character_set_client = utf8 */;
142CREATE TABLE `calendar_events` (
143 `id` int(11) NOT NULL AUTO_INCREMENT,
144 `team_calendar_id` int(11) DEFAULT NULL,
145 `staff_id` int(11) DEFAULT NULL,
146 `status` varchar(255) NOT NULL,
147 `memo` text,
148 `event_id` varchar(255) NOT NULL,
149 `created_at` datetime NOT NULL,
150 `updated_at` datetime NOT NULL,
151 PRIMARY KEY (`id`),
152 UNIQUE KEY `index_calendar_events_on_event_id` (`event_id`),
153 KEY `index_calendar_events_on_team_calendar_id` (`team_calendar_id`),
154 KEY `index_calendar_events_on_staff_id` (`staff_id`)
155) ENGINE=InnoDB DEFAULT CHARSET=utf8;
156/*!40101 SET character_set_client = @saved_cs_client */;
157
158--
159-- Table structure for table `cloth_records`
160--
161
162DROP TABLE IF EXISTS `cloth_records`;
163/*!40101 SET @saved_cs_client = @@character_set_client */;
164/*!40101 SET character_set_client = utf8 */;
165CREATE TABLE `cloth_records` (
166 `id` int(11) NOT NULL AUTO_INCREMENT,
167 `cloth_id` int(11) DEFAULT NULL,
168 `order_item_id` int(11) DEFAULT NULL,
169 `consumed_length` float DEFAULT NULL,
170 `created_at` datetime NOT NULL,
171 `updated_at` datetime NOT NULL,
172 PRIMARY KEY (`id`),
173 KEY `index_cloth_records_on_cloth_id` (`cloth_id`),
174 KEY `index_cloth_records_on_order_item_id` (`order_item_id`),
175 CONSTRAINT `fk_rails_55f1dea547` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`),
176 CONSTRAINT `fk_rails_de640fc0bd` FOREIGN KEY (`cloth_id`) REFERENCES `cloths` (`id`)
177) ENGINE=InnoDB AUTO_INCREMENT=264 DEFAULT CHARSET=utf8;
178/*!40101 SET character_set_client = @saved_cs_client */;
179
180--
181-- Table structure for table `cloths`
182--
183
184DROP TABLE IF EXISTS `cloths`;
185/*!40101 SET @saved_cs_client = @@character_set_client */;
186/*!40101 SET character_set_client = utf8 */;
187CREATE TABLE `cloths` (
188 `id` int(11) NOT NULL AUTO_INCREMENT,
189 `name` varchar(255) DEFAULT NULL,
190 `price` decimal(10,0) DEFAULT NULL,
191 `created_at` datetime NOT NULL,
192 `updated_at` datetime NOT NULL,
193 `photo_file_name` varchar(255) DEFAULT NULL,
194 `photo_content_type` varchar(255) DEFAULT NULL,
195 `photo_file_size` int(11) DEFAULT NULL,
196 `photo_updated_at` datetime DEFAULT NULL,
197 `kind` varchar(255) DEFAULT NULL,
198 `length` float DEFAULT NULL,
199 `used_length` float DEFAULT NULL,
200 `company` varchar(255) DEFAULT NULL,
201 PRIMARY KEY (`id`)
202) ENGINE=InnoDB AUTO_INCREMENT=938 DEFAULT CHARSET=utf8;
203/*!40101 SET character_set_client = @saved_cs_client */;
204
205--
206-- Table structure for table `complimentaries`
207--
208
209DROP TABLE IF EXISTS `complimentaries`;
210/*!40101 SET @saved_cs_client = @@character_set_client */;
211/*!40101 SET character_set_client = utf8 */;
212CREATE TABLE `complimentaries` (
213 `id` int(11) NOT NULL AUTO_INCREMENT,
214 `user_id` int(11) DEFAULT NULL,
215 `referrer` varchar(255) DEFAULT NULL,
216 `item` varchar(255) DEFAULT NULL,
217 `note` text,
218 `state` varchar(255) DEFAULT NULL,
219 `created_at` datetime NOT NULL,
220 `updated_at` datetime NOT NULL,
221 PRIMARY KEY (`id`),
222 KEY `index_complimentaries_on_user_id` (`user_id`),
223 CONSTRAINT `fk_rails_c8cd1cb837` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
224) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
225/*!40101 SET character_set_client = @saved_cs_client */;
226
227--
228-- Table structure for table `counseling_schedules`
229--
230
231DROP TABLE IF EXISTS `counseling_schedules`;
232/*!40101 SET @saved_cs_client = @@character_set_client */;
233/*!40101 SET character_set_client = utf8 */;
234CREATE TABLE `counseling_schedules` (
235 `id` int(11) NOT NULL AUTO_INCREMENT,
236 `user_id` int(11) DEFAULT NULL,
237 `staff_id` int(11) DEFAULT NULL,
238 `scheduled_at` datetime DEFAULT NULL,
239 `scheduled_for` varchar(255) DEFAULT NULL,
240 `list_type` varchar(255) DEFAULT NULL,
241 `note` varchar(255) DEFAULT NULL,
242 `state` varchar(255) DEFAULT NULL,
243 `floor` varchar(255) DEFAULT NULL,
244 `room` varchar(255) DEFAULT NULL,
245 `staff_leave` varchar(255) DEFAULT NULL,
246 `created_at` datetime NOT NULL,
247 `updated_at` datetime NOT NULL,
248 `complete` varchar(255) DEFAULT NULL,
249 PRIMARY KEY (`id`),
250 KEY `index_counseling_schedules_on_user_id` (`user_id`),
251 KEY `index_counseling_schedules_on_staff_id` (`staff_id`),
252 CONSTRAINT `fk_rails_80881a4072` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
253 CONSTRAINT `fk_rails_ee26fc250e` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
254) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
255/*!40101 SET character_set_client = @saved_cs_client */;
256
257--
258-- Table structure for table `customer_calls`
259--
260
261DROP TABLE IF EXISTS `customer_calls`;
262/*!40101 SET @saved_cs_client = @@character_set_client */;
263/*!40101 SET character_set_client = utf8 */;
264CREATE TABLE `customer_calls` (
265 `id` int(11) NOT NULL AUTO_INCREMENT,
266 `user_id` int(11) DEFAULT NULL,
267 `staff_id` int(11) DEFAULT NULL,
268 `called_at` datetime DEFAULT NULL,
269 `list_type` varchar(255) DEFAULT NULL,
270 `note` text,
271 `created_at` datetime NOT NULL,
272 `updated_at` datetime NOT NULL,
273 PRIMARY KEY (`id`),
274 KEY `index_customer_calls_on_user_id` (`user_id`),
275 KEY `index_customer_calls_on_staff_id` (`staff_id`),
276 CONSTRAINT `fk_rails_8edbc09dda` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`),
277 CONSTRAINT `fk_rails_ba985e27ff` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
278) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
279/*!40101 SET character_set_client = @saved_cs_client */;
280
281--
282-- Table structure for table `daily_reports`
283--
284
285DROP TABLE IF EXISTS `daily_reports`;
286/*!40101 SET @saved_cs_client = @@character_set_client */;
287/*!40101 SET character_set_client = utf8 */;
288CREATE TABLE `daily_reports` (
289 `id` int(11) NOT NULL AUTO_INCREMENT,
290 `date` date DEFAULT NULL,
291 `business` text,
292 `today` text,
293 `timeline` json DEFAULT NULL,
294 `staff_id` int(11) DEFAULT NULL,
295 `created_at` datetime NOT NULL,
296 `updated_at` datetime NOT NULL,
297 PRIMARY KEY (`id`),
298 KEY `index_daily_reports_on_staff_id` (`staff_id`)
299) ENGINE=InnoDB AUTO_INCREMENT=1251 DEFAULT CHARSET=utf8;
300/*!40101 SET character_set_client = @saved_cs_client */;
301
302--
303-- Table structure for table `delayed_jobs`
304--
305
306DROP TABLE IF EXISTS `delayed_jobs`;
307/*!40101 SET @saved_cs_client = @@character_set_client */;
308/*!40101 SET character_set_client = utf8 */;
309CREATE TABLE `delayed_jobs` (
310 `id` int(11) NOT NULL AUTO_INCREMENT,
311 `priority` int(11) NOT NULL DEFAULT '0',
312 `attempts` int(11) NOT NULL DEFAULT '0',
313 `handler` text NOT NULL,
314 `last_error` text,
315 `run_at` datetime DEFAULT NULL,
316 `locked_at` datetime DEFAULT NULL,
317 `failed_at` datetime DEFAULT NULL,
318 `locked_by` varchar(255) DEFAULT NULL,
319 `queue` varchar(255) DEFAULT NULL,
320 `created_at` datetime DEFAULT NULL,
321 `updated_at` datetime DEFAULT NULL,
322 PRIMARY KEY (`id`),
323 KEY `delayed_jobs_priority` (`priority`,`run_at`)
324) ENGINE=InnoDB DEFAULT CHARSET=utf8;
325/*!40101 SET character_set_client = @saved_cs_client */;
326
327--
328-- Table structure for table `delivery_schedules`
329--
330
331DROP TABLE IF EXISTS `delivery_schedules`;
332/*!40101 SET @saved_cs_client = @@character_set_client */;
333/*!40101 SET character_set_client = utf8 */;
334CREATE TABLE `delivery_schedules` (
335 `id` int(11) NOT NULL AUTO_INCREMENT,
336 `user_id` int(11) DEFAULT NULL,
337 `staff_id` int(11) DEFAULT NULL,
338 `scheduled_at` date DEFAULT NULL,
339 `list_type` varchar(255) DEFAULT NULL,
340 `state` varchar(255) DEFAULT NULL,
341 `fast_track` varchar(255) DEFAULT NULL,
342 `note` varchar(255) DEFAULT NULL,
343 `created_at` datetime NOT NULL,
344 `updated_at` datetime NOT NULL,
345 PRIMARY KEY (`id`),
346 KEY `index_delivery_schedules_on_user_id` (`user_id`),
347 KEY `index_delivery_schedules_on_staff_id` (`staff_id`),
348 CONSTRAINT `fk_rails_60b75651fd` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
349 CONSTRAINT `fk_rails_bb4a75f936` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
350) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
351/*!40101 SET character_set_client = @saved_cs_client */;
352
353--
354-- Table structure for table `district_groups`
355--
356
357DROP TABLE IF EXISTS `district_groups`;
358/*!40101 SET @saved_cs_client = @@character_set_client */;
359/*!40101 SET character_set_client = utf8 */;
360CREATE TABLE `district_groups` (
361 `id` int(11) NOT NULL AUTO_INCREMENT,
362 `name` varchar(255) DEFAULT NULL,
363 `district_names` varchar(255) DEFAULT NULL,
364 `created_at` datetime NOT NULL,
365 `updated_at` datetime NOT NULL,
366 PRIMARY KEY (`id`)
367) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
368/*!40101 SET character_set_client = @saved_cs_client */;
369
370--
371-- Table structure for table `districts`
372--
373
374DROP TABLE IF EXISTS `districts`;
375/*!40101 SET @saved_cs_client = @@character_set_client */;
376/*!40101 SET character_set_client = utf8 */;
377CREATE TABLE `districts` (
378 `id` int(11) NOT NULL AUTO_INCREMENT,
379 `name` varchar(255) NOT NULL,
380 `district_group_id` int(11) DEFAULT NULL,
381 `created_at` datetime NOT NULL,
382 `updated_at` datetime NOT NULL,
383 PRIMARY KEY (`id`),
384 UNIQUE KEY `index_districts_on_name` (`name`),
385 KEY `index_districts_on_district_group_id` (`district_group_id`),
386 CONSTRAINT `fk_rails_56b7af605c` FOREIGN KEY (`district_group_id`) REFERENCES `district_groups` (`id`)
387) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8;
388/*!40101 SET character_set_client = @saved_cs_client */;
389
390--
391-- Table structure for table `fittings`
392--
393
394DROP TABLE IF EXISTS `fittings`;
395/*!40101 SET @saved_cs_client = @@character_set_client */;
396/*!40101 SET character_set_client = utf8 */;
397CREATE TABLE `fittings` (
398 `id` int(11) NOT NULL AUTO_INCREMENT,
399 `order_item_id` int(11) DEFAULT NULL,
400 `options` json DEFAULT NULL,
401 `aasm_state` varchar(255) DEFAULT NULL,
402 `created_at` datetime NOT NULL,
403 `updated_at` datetime NOT NULL,
404 PRIMARY KEY (`id`),
405 KEY `index_fittings_on_order_item_id` (`order_item_id`),
406 CONSTRAINT `fk_rails_37d9e86ee3` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`)
407) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
408/*!40101 SET character_set_client = @saved_cs_client */;
409
410--
411-- Table structure for table `groups`
412--
413
414DROP TABLE IF EXISTS `groups`;
415/*!40101 SET @saved_cs_client = @@character_set_client */;
416/*!40101 SET character_set_client = utf8 */;
417CREATE TABLE `groups` (
418 `id` int(11) NOT NULL AUTO_INCREMENT,
419 `name` varchar(255) DEFAULT NULL,
420 `memo` text,
421 `created_at` datetime NOT NULL,
422 `updated_at` datetime NOT NULL,
423 `branch` varchar(255) DEFAULT NULL,
424 PRIMARY KEY (`id`)
425) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
426/*!40101 SET character_set_client = @saved_cs_client */;
427
428--
429-- Table structure for table `house_schedules`
430--
431
432DROP TABLE IF EXISTS `house_schedules`;
433/*!40101 SET @saved_cs_client = @@character_set_client */;
434/*!40101 SET character_set_client = utf8 */;
435CREATE TABLE `house_schedules` (
436 `id` int(11) NOT NULL AUTO_INCREMENT,
437 `user_id` int(11) DEFAULT NULL,
438 `staff_id` int(11) DEFAULT NULL,
439 `sub_staff_id` int(11) DEFAULT NULL,
440 `item` varchar(255) DEFAULT NULL,
441 `scheduled_at` datetime DEFAULT NULL,
442 `scheduled_for` varchar(255) DEFAULT NULL,
443 `list_type` varchar(255) DEFAULT NULL,
444 `note` varchar(255) DEFAULT NULL,
445 `state` varchar(255) DEFAULT NULL,
446 `floor` varchar(255) DEFAULT NULL,
447 `room` varchar(255) DEFAULT NULL,
448 `delivery` varchar(255) DEFAULT NULL,
449 `staff_leave` varchar(255) DEFAULT NULL,
450 `created_at` datetime NOT NULL,
451 `updated_at` datetime NOT NULL,
452 `complete` varchar(255) DEFAULT NULL,
453 PRIMARY KEY (`id`),
454 KEY `index_house_schedules_on_user_id` (`user_id`),
455 KEY `index_house_schedules_on_staff_id` (`staff_id`),
456 CONSTRAINT `fk_rails_035dfa709e` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
457 CONSTRAINT `fk_rails_56151ea49a` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
458) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
459/*!40101 SET character_set_client = @saved_cs_client */;
460
461--
462-- Table structure for table `logistics`
463--
464
465DROP TABLE IF EXISTS `logistics`;
466/*!40101 SET @saved_cs_client = @@character_set_client */;
467/*!40101 SET character_set_client = utf8 */;
468CREATE TABLE `logistics` (
469 `id` int(11) NOT NULL AUTO_INCREMENT,
470 `aasm_state` varchar(255) DEFAULT NULL,
471 `created_at` datetime NOT NULL,
472 `updated_at` datetime NOT NULL,
473 `order_item_id` int(11) DEFAULT NULL,
474 PRIMARY KEY (`id`),
475 KEY `index_logistics_on_order_item_id` (`order_item_id`),
476 CONSTRAINT `fk_rails_d65192bb40` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`)
477) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
478/*!40101 SET character_set_client = @saved_cs_client */;
479
480--
481-- Table structure for table `manufacture_unit_prices`
482--
483
484DROP TABLE IF EXISTS `manufacture_unit_prices`;
485/*!40101 SET @saved_cs_client = @@character_set_client */;
486/*!40101 SET character_set_client = utf8 */;
487CREATE TABLE `manufacture_unit_prices` (
488 `id` int(11) NOT NULL AUTO_INCREMENT,
489 `option` varchar(255) DEFAULT NULL,
490 `collection` varchar(255) DEFAULT NULL,
491 `price` int(11) DEFAULT '0',
492 `created_at` datetime NOT NULL,
493 `updated_at` datetime NOT NULL,
494 PRIMARY KEY (`id`)
495) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
496/*!40101 SET character_set_client = @saved_cs_client */;
497
498--
499-- Table structure for table `measured_values`
500--
501
502DROP TABLE IF EXISTS `measured_values`;
503/*!40101 SET @saved_cs_client = @@character_set_client */;
504/*!40101 SET character_set_client = utf8 */;
505CREATE TABLE `measured_values` (
506 `id` int(11) NOT NULL AUTO_INCREMENT,
507 `custom_fields` json DEFAULT NULL,
508 `created_at` datetime NOT NULL,
509 `updated_at` datetime NOT NULL,
510 `user_id` int(11) DEFAULT NULL,
511 PRIMARY KEY (`id`)
512) ENGINE=InnoDB AUTO_INCREMENT=682 DEFAULT CHARSET=utf8;
513/*!40101 SET character_set_client = @saved_cs_client */;
514
515--
516-- Table structure for table `order_item_histories`
517--
518
519DROP TABLE IF EXISTS `order_item_histories`;
520/*!40101 SET @saved_cs_client = @@character_set_client */;
521/*!40101 SET character_set_client = utf8 */;
522CREATE TABLE `order_item_histories` (
523 `id` int(11) NOT NULL AUTO_INCREMENT,
524 `order_item_id` int(11) DEFAULT NULL,
525 `suit_part` varchar(255) DEFAULT NULL,
526 `items_count` int(11) DEFAULT NULL,
527 `unit_price` int(11) DEFAULT NULL,
528 `options` json DEFAULT NULL,
529 `note_down` text,
530 `aasm_state` varchar(255) DEFAULT NULL,
531 `created_at` datetime NOT NULL,
532 `updated_at` datetime NOT NULL,
533 PRIMARY KEY (`id`),
534 KEY `index_order_item_histories_on_order_item_id` (`order_item_id`)
535) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
536/*!40101 SET character_set_client = @saved_cs_client */;
537
538--
539-- Table structure for table `order_items`
540--
541
542DROP TABLE IF EXISTS `order_items`;
543/*!40101 SET @saved_cs_client = @@character_set_client */;
544/*!40101 SET character_set_client = utf8 */;
545CREATE TABLE `order_items` (
546 `id` int(11) NOT NULL AUTO_INCREMENT,
547 `order_id` int(11) DEFAULT NULL,
548 `user_id` int(11) DEFAULT NULL,
549 `suit_part` varchar(255) DEFAULT NULL,
550 `items_count` int(11) DEFAULT NULL,
551 `unit_price` int(11) DEFAULT NULL,
552 `customizing_options` json DEFAULT NULL,
553 `created_at` datetime NOT NULL,
554 `updated_at` datetime NOT NULL,
555 `note_down` text,
556 `aasm_state` varchar(255) DEFAULT NULL,
557 PRIMARY KEY (`id`),
558 KEY `index_order_items_on_order_id` (`order_id`) USING BTREE,
559 KEY `index_order_items_on_user_id` (`user_id`) USING BTREE
560) ENGINE=InnoDB AUTO_INCREMENT=213 DEFAULT CHARSET=utf8;
561/*!40101 SET character_set_client = @saved_cs_client */;
562
563--
564-- Table structure for table `order_payment_methods`
565--
566
567DROP TABLE IF EXISTS `order_payment_methods`;
568/*!40101 SET @saved_cs_client = @@character_set_client */;
569/*!40101 SET character_set_client = utf8 */;
570CREATE TABLE `order_payment_methods` (
571 `id` int(11) NOT NULL AUTO_INCREMENT,
572 `kind` varchar(255) DEFAULT 'undecided',
573 `price` decimal(10,0) DEFAULT '0',
574 `account_name` varchar(255) DEFAULT NULL,
575 `created_at` datetime NOT NULL,
576 `updated_at` datetime NOT NULL,
577 `order_payment_id` int(11) DEFAULT NULL,
578 `aasm_state` varchar(255) DEFAULT NULL,
579 PRIMARY KEY (`id`),
580 KEY `index_order_payment_methods_on_order_payment_id` (`order_payment_id`)
581) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8;
582/*!40101 SET character_set_client = @saved_cs_client */;
583
584--
585-- Table structure for table `order_payments`
586--
587
588DROP TABLE IF EXISTS `order_payments`;
589/*!40101 SET @saved_cs_client = @@character_set_client */;
590/*!40101 SET character_set_client = utf8 */;
591CREATE TABLE `order_payments` (
592 `id` int(11) NOT NULL AUTO_INCREMENT,
593 `staff_id` int(11) DEFAULT NULL,
594 `order_id` int(11) DEFAULT NULL,
595 `created_at` datetime NOT NULL,
596 `updated_at` datetime NOT NULL,
597 `aasm_state` varchar(255) DEFAULT NULL,
598 PRIMARY KEY (`id`),
599 KEY `index_order_payments_on_staff_id` (`staff_id`),
600 KEY `index_order_payments_on_order_id` (`order_id`),
601 CONSTRAINT `fk_rails_9fe36af2ae` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`),
602 CONSTRAINT `fk_rails_ecfe8f04cd` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`)
603) ENGINE=InnoDB AUTO_INCREMENT=220 DEFAULT CHARSET=utf8;
604/*!40101 SET character_set_client = @saved_cs_client */;
605
606--
607-- Table structure for table `order_shipments`
608--
609
610DROP TABLE IF EXISTS `order_shipments`;
611/*!40101 SET @saved_cs_client = @@character_set_client */;
612/*!40101 SET character_set_client = utf8 */;
613CREATE TABLE `order_shipments` (
614 `id` int(11) NOT NULL AUTO_INCREMENT,
615 `road_name` varchar(255) DEFAULT NULL,
616 `zipcode` varchar(255) DEFAULT NULL,
617 `name` varchar(255) DEFAULT NULL,
618 `phone` varchar(255) DEFAULT NULL,
619 `created_at` datetime NOT NULL,
620 `updated_at` datetime NOT NULL,
621 `detail` varchar(255) DEFAULT NULL,
622 `aasm_state` varchar(255) DEFAULT NULL,
623 `order_item_id` int(11) DEFAULT NULL,
624 PRIMARY KEY (`id`),
625 KEY `index_order_shipments_on_order_item_id` (`order_item_id`)
626) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
627/*!40101 SET character_set_client = @saved_cs_client */;
628
629--
630-- Table structure for table `orders`
631--
632
633DROP TABLE IF EXISTS `orders`;
634/*!40101 SET @saved_cs_client = @@character_set_client */;
635/*!40101 SET character_set_client = utf8 */;
636CREATE TABLE `orders` (
637 `id` int(11) NOT NULL AUTO_INCREMENT,
638 `note_down` text,
639 `created_at` datetime NOT NULL,
640 `updated_at` datetime NOT NULL,
641 `user_id` int(11) DEFAULT NULL,
642 `customizing_options` json DEFAULT NULL,
643 `aasm_state` varchar(255) DEFAULT NULL,
644 `selected_product` varchar(255) DEFAULT NULL,
645 `selected_cloths` text,
646 PRIMARY KEY (`id`)
647) ENGINE=InnoDB AUTO_INCREMENT=310 DEFAULT CHARSET=utf8;
648/*!40101 SET character_set_client = @saved_cs_client */;
649
650--
651-- Table structure for table `payats`
652--
653
654DROP TABLE IF EXISTS `payats`;
655/*!40101 SET @saved_cs_client = @@character_set_client */;
656/*!40101 SET character_set_client = utf8 */;
657CREATE TABLE `payats` (
658 `id` int(11) NOT NULL AUTO_INCREMENT,
659 `no` int(11) DEFAULT NULL,
660 `regdate` datetime DEFAULT NULL,
661 `client_order_no` int(11) DEFAULT NULL,
662 `related_payment_no` int(11) DEFAULT NULL,
663 `original` text,
664 `approval_no` varchar(255) DEFAULT NULL,
665 `net_id` varchar(255) DEFAULT NULL,
666 `payment_type` varchar(255) DEFAULT NULL,
667 `transaction_type` varchar(255) DEFAULT NULL,
668 `amount` int(11) DEFAULT NULL,
669 `tax` int(11) DEFAULT NULL,
670 `fee` int(11) DEFAULT NULL,
671 `plain_card_no` varchar(255) DEFAULT NULL,
672 `card_valid_date` varchar(255) DEFAULT NULL,
673 `card_type` varchar(255) DEFAULT NULL,
674 `card_name` varchar(255) DEFAULT NULL,
675 `card_installment_month` int(11) DEFAULT NULL,
676 `customer_email` varchar(255) DEFAULT NULL,
677 `customer_mobile` varchar(255) DEFAULT NULL,
678 `additional_data` varchar(255) DEFAULT NULL,
679 `lat` float DEFAULT NULL,
680 `lng` float DEFAULT NULL,
681 `store_no` int(11) DEFAULT NULL,
682 `store_screen_name` varchar(255) DEFAULT NULL,
683 `store_name` varchar(255) DEFAULT NULL,
684 `store_email` varchar(255) DEFAULT NULL,
685 `store_mobile` varchar(255) DEFAULT NULL,
686 `employee_no` int(11) DEFAULT NULL,
687 `employee_screen_name` varchar(255) DEFAULT NULL,
688 `employee_name` varchar(255) DEFAULT NULL,
689 `employee_email` varchar(255) DEFAULT NULL,
690 `employee_mobile` varchar(255) DEFAULT NULL,
691 `comment` text,
692 `items` text,
693 `created_at` datetime NOT NULL,
694 `updated_at` datetime NOT NULL,
695 `order_id` int(11) DEFAULT NULL,
696 PRIMARY KEY (`id`),
697 KEY `index_payats_on_order_id` (`order_id`),
698 CONSTRAINT `fk_rails_4a1c07bd0f` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`)
699) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8;
700/*!40101 SET character_set_client = @saved_cs_client */;
701
702--
703-- Table structure for table `phone_calls`
704--
705
706DROP TABLE IF EXISTS `phone_calls`;
707/*!40101 SET @saved_cs_client = @@character_set_client */;
708/*!40101 SET character_set_client = utf8 */;
709CREATE TABLE `phone_calls` (
710 `id` int(11) NOT NULL AUTO_INCREMENT,
711 `user_visit_appointment_id` int(11) DEFAULT NULL,
712 `staff_id` int(11) DEFAULT NULL,
713 `memo` text,
714 `goal` varchar(255) NOT NULL DEFAULT 'other',
715 `result` varchar(255) NOT NULL DEFAULT 'answered',
716 `datetime` datetime NOT NULL,
717 `created_at` datetime NOT NULL,
718 `updated_at` datetime NOT NULL,
719 PRIMARY KEY (`id`),
720 KEY `index_phone_calls_on_user_visit_appointment_id` (`user_visit_appointment_id`),
721 KEY `index_phone_calls_on_staff_id` (`staff_id`),
722 CONSTRAINT `fk_rails_38e9e315ff` FOREIGN KEY (`user_visit_appointment_id`) REFERENCES `user_visit_appointments` (`id`),
723 CONSTRAINT `fk_rails_49c78e3587` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
724) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
725/*!40101 SET character_set_client = @saved_cs_client */;
726
727--
728-- Table structure for table `pictures`
729--
730
731DROP TABLE IF EXISTS `pictures`;
732/*!40101 SET @saved_cs_client = @@character_set_client */;
733/*!40101 SET character_set_client = utf8 */;
734CREATE TABLE `pictures` (
735 `id` int(11) NOT NULL AUTO_INCREMENT,
736 `image_file_name` varchar(255) DEFAULT NULL,
737 `image_content_type` varchar(255) DEFAULT NULL,
738 `image_file_size` int(11) DEFAULT NULL,
739 `image_updated_at` datetime DEFAULT NULL,
740 `imageable_id` int(11) DEFAULT NULL,
741 `imageable_type` varchar(255) DEFAULT NULL,
742 `guid` varchar(255) DEFAULT NULL,
743 `created_at` datetime NOT NULL,
744 `updated_at` datetime NOT NULL,
745 PRIMARY KEY (`id`)
746) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8;
747/*!40101 SET character_set_client = @saved_cs_client */;
748
749--
750-- Table structure for table `place_orders`
751--
752
753DROP TABLE IF EXISTS `place_orders`;
754/*!40101 SET @saved_cs_client = @@character_set_client */;
755/*!40101 SET character_set_client = utf8 */;
756CREATE TABLE `place_orders` (
757 `id` int(11) NOT NULL AUTO_INCREMENT,
758 `options` json DEFAULT NULL,
759 `order_item_id` int(11) DEFAULT NULL,
760 `created_at` datetime NOT NULL,
761 `updated_at` datetime NOT NULL,
762 `aasm_state` varchar(255) DEFAULT NULL,
763 PRIMARY KEY (`id`),
764 KEY `index_place_orders_on_order_item_id` (`order_item_id`)
765) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8;
766/*!40101 SET character_set_client = @saved_cs_client */;
767
768--
769-- Table structure for table `posts`
770--
771
772DROP TABLE IF EXISTS `posts`;
773/*!40101 SET @saved_cs_client = @@character_set_client */;
774/*!40101 SET character_set_client = utf8 */;
775CREATE TABLE `posts` (
776 `id` int(11) NOT NULL AUTO_INCREMENT,
777 `title` varchar(255) DEFAULT NULL,
778 `body` text,
779 `staff_id` int(11) DEFAULT NULL,
780 `priority` tinyint(1) DEFAULT NULL,
781 `show_contents_in_list` tinyint(1) DEFAULT NULL,
782 `created_at` datetime NOT NULL,
783 `updated_at` datetime NOT NULL,
784 `branch` varchar(255) DEFAULT NULL,
785 PRIMARY KEY (`id`),
786 KEY `index_posts_on_staff_id` (`staff_id`),
787 CONSTRAINT `fk_rails_7482c52578` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
788) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
789/*!40101 SET character_set_client = @saved_cs_client */;
790
791--
792-- Table structure for table `product_items`
793--
794
795DROP TABLE IF EXISTS `product_items`;
796/*!40101 SET @saved_cs_client = @@character_set_client */;
797/*!40101 SET character_set_client = utf8 */;
798CREATE TABLE `product_items` (
799 `id` int(11) NOT NULL AUTO_INCREMENT,
800 `product_id` int(11) DEFAULT NULL,
801 `product_type` varchar(255) DEFAULT NULL,
802 `cloths` text,
803 `items` text,
804 `created_at` datetime NOT NULL,
805 `updated_at` datetime NOT NULL,
806 `guid` varchar(255) DEFAULT NULL,
807 PRIMARY KEY (`id`),
808 UNIQUE KEY `index_product_items_on_guid` (`guid`),
809 KEY `index_product_items_on_product_id` (`product_id`)
810) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
811/*!40101 SET character_set_client = @saved_cs_client */;
812
813--
814-- Table structure for table `product_packages`
815--
816
817DROP TABLE IF EXISTS `product_packages`;
818/*!40101 SET @saved_cs_client = @@character_set_client */;
819/*!40101 SET character_set_client = utf8 */;
820CREATE TABLE `product_packages` (
821 `id` int(11) NOT NULL AUTO_INCREMENT,
822 `name` varchar(255) DEFAULT NULL,
823 `created_at` datetime NOT NULL,
824 `updated_at` datetime NOT NULL,
825 `guid` varchar(255) DEFAULT NULL,
826 PRIMARY KEY (`id`),
827 UNIQUE KEY `index_product_packages_on_guid` (`guid`)
828) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
829/*!40101 SET character_set_client = @saved_cs_client */;
830
831--
832-- Table structure for table `products`
833--
834
835DROP TABLE IF EXISTS `products`;
836/*!40101 SET @saved_cs_client = @@character_set_client */;
837/*!40101 SET character_set_client = utf8 */;
838CREATE TABLE `products` (
839 `id` int(11) NOT NULL AUTO_INCREMENT,
840 `name` varchar(255) DEFAULT NULL,
841 `created_at` datetime NOT NULL,
842 `updated_at` datetime NOT NULL,
843 `price` int(11) DEFAULT NULL,
844 `product_package_id` int(11) DEFAULT NULL,
845 `guid` varchar(255) DEFAULT NULL,
846 PRIMARY KEY (`id`),
847 UNIQUE KEY `index_products_on_guid` (`guid`),
848 KEY `index_products_on_product_package_id` (`product_package_id`),
849 CONSTRAINT `fk_rails_ecebf3e63b` FOREIGN KEY (`product_package_id`) REFERENCES `product_packages` (`id`)
850) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
851/*!40101 SET character_set_client = @saved_cs_client */;
852
853--
854-- Table structure for table `repair_tracks`
855--
856
857DROP TABLE IF EXISTS `repair_tracks`;
858/*!40101 SET @saved_cs_client = @@character_set_client */;
859/*!40101 SET character_set_client = utf8 */;
860CREATE TABLE `repair_tracks` (
861 `id` int(11) NOT NULL AUTO_INCREMENT,
862 `user_id` int(11) DEFAULT NULL,
863 `staff_id` int(11) DEFAULT NULL,
864 `ordered_at` date DEFAULT NULL,
865 `delivered_at` date DEFAULT NULL,
866 `item` varchar(255) DEFAULT NULL,
867 `repair_item` varchar(255) DEFAULT NULL,
868 `keep_item` varchar(255) DEFAULT NULL,
869 `note` varchar(255) DEFAULT NULL,
870 `list_type` varchar(255) DEFAULT NULL,
871 `state` varchar(255) DEFAULT NULL,
872 `created_at` datetime NOT NULL,
873 `updated_at` datetime NOT NULL,
874 PRIMARY KEY (`id`),
875 KEY `index_repair_tracks_on_user_id` (`user_id`),
876 KEY `index_repair_tracks_on_staff_id` (`staff_id`),
877 CONSTRAINT `fk_rails_0d2ec9da1b` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
878 CONSTRAINT `fk_rails_9df6294a60` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
879) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
880/*!40101 SET character_set_client = @saved_cs_client */;
881
882--
883-- Table structure for table `repairs`
884--
885
886DROP TABLE IF EXISTS `repairs`;
887/*!40101 SET @saved_cs_client = @@character_set_client */;
888/*!40101 SET character_set_client = utf8 */;
889CREATE TABLE `repairs` (
890 `id` int(11) NOT NULL AUTO_INCREMENT,
891 `order_item_id` int(11) DEFAULT NULL,
892 `options` json DEFAULT NULL,
893 `aasm_state` varchar(255) DEFAULT NULL,
894 `created_at` datetime NOT NULL,
895 `updated_at` datetime NOT NULL,
896 PRIMARY KEY (`id`),
897 KEY `index_repairs_on_order_item_id` (`order_item_id`),
898 CONSTRAINT `fk_rails_bbfbfd4b19` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`)
899) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
900/*!40101 SET character_set_client = @saved_cs_client */;
901
902--
903-- Table structure for table `report_comments`
904--
905
906DROP TABLE IF EXISTS `report_comments`;
907/*!40101 SET @saved_cs_client = @@character_set_client */;
908/*!40101 SET character_set_client = utf8 */;
909CREATE TABLE `report_comments` (
910 `id` int(11) NOT NULL AUTO_INCREMENT,
911 `content` text,
912 `staff_id` int(11) DEFAULT NULL,
913 `daily_report_id` int(11) DEFAULT NULL,
914 `created_at` datetime NOT NULL,
915 `updated_at` datetime NOT NULL,
916 PRIMARY KEY (`id`),
917 KEY `index_report_comments_on_staff_id` (`staff_id`),
918 KEY `index_report_comments_on_daily_report_id` (`daily_report_id`)
919) ENGINE=InnoDB AUTO_INCREMENT=312 DEFAULT CHARSET=utf8;
920/*!40101 SET character_set_client = @saved_cs_client */;
921
922--
923-- Table structure for table `revenue_goals`
924--
925
926DROP TABLE IF EXISTS `revenue_goals`;
927/*!40101 SET @saved_cs_client = @@character_set_client */;
928/*!40101 SET character_set_client = utf8 */;
929CREATE TABLE `revenue_goals` (
930 `id` int(11) NOT NULL AUTO_INCREMENT,
931 `month` int(11) DEFAULT NULL,
932 `nth_week` int(11) DEFAULT NULL,
933 `amount` int(11) DEFAULT NULL,
934 `staff_id` int(11) DEFAULT NULL,
935 `created_at` datetime NOT NULL,
936 `updated_at` datetime NOT NULL,
937 PRIMARY KEY (`id`),
938 KEY `index_revenue_goals_on_staff_id` (`staff_id`),
939 CONSTRAINT `fk_rails_19ad20d774` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
940) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
941/*!40101 SET character_set_client = @saved_cs_client */;
942
943--
944-- Table structure for table `roles`
945--
946
947DROP TABLE IF EXISTS `roles`;
948/*!40101 SET @saved_cs_client = @@character_set_client */;
949/*!40101 SET character_set_client = utf8 */;
950CREATE TABLE `roles` (
951 `id` int(11) NOT NULL AUTO_INCREMENT,
952 `name` varchar(255) DEFAULT NULL,
953 `resource_type` varchar(255) DEFAULT NULL,
954 `resource_id` int(11) DEFAULT NULL,
955 `created_at` datetime DEFAULT NULL,
956 `updated_at` datetime DEFAULT NULL,
957 PRIMARY KEY (`id`),
958 KEY `index_roles_on_name_and_resource_type_and_resource_id` (`name`,`resource_type`,`resource_id`) USING BTREE,
959 KEY `index_roles_on_name` (`name`) USING BTREE
960) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
961/*!40101 SET character_set_client = @saved_cs_client */;
962
963--
964-- Table structure for table `schema_migrations`
965--
966
967DROP TABLE IF EXISTS `schema_migrations`;
968/*!40101 SET @saved_cs_client = @@character_set_client */;
969/*!40101 SET character_set_client = utf8 */;
970CREATE TABLE `schema_migrations` (
971 `version` varchar(255) NOT NULL,
972 PRIMARY KEY (`version`)
973) ENGINE=InnoDB DEFAULT CHARSET=utf8;
974/*!40101 SET character_set_client = @saved_cs_client */;
975
976--
977-- Table structure for table `shirts_tracks`
978--
979
980DROP TABLE IF EXISTS `shirts_tracks`;
981/*!40101 SET @saved_cs_client = @@character_set_client */;
982/*!40101 SET character_set_client = utf8 */;
983CREATE TABLE `shirts_tracks` (
984 `id` int(11) NOT NULL AUTO_INCREMENT,
985 `user_id` int(11) DEFAULT NULL,
986 `staff_id` int(11) DEFAULT NULL,
987 `ordered_at` date DEFAULT NULL,
988 `delivered_at` date DEFAULT NULL,
989 `item` varchar(255) DEFAULT NULL,
990 `note` varchar(255) DEFAULT NULL,
991 `list_type` varchar(255) DEFAULT NULL,
992 `state` varchar(255) DEFAULT NULL,
993 `created_at` datetime NOT NULL,
994 `updated_at` datetime NOT NULL,
995 PRIMARY KEY (`id`),
996 KEY `index_shirts_tracks_on_user_id` (`user_id`),
997 KEY `index_shirts_tracks_on_staff_id` (`staff_id`),
998 CONSTRAINT `fk_rails_60e0ff81c8` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`),
999 CONSTRAINT `fk_rails_ffe29af80b` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
1000) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
1001/*!40101 SET character_set_client = @saved_cs_client */;
1002
1003--
1004-- Table structure for table `shoes_tracks`
1005--
1006
1007DROP TABLE IF EXISTS `shoes_tracks`;
1008/*!40101 SET @saved_cs_client = @@character_set_client */;
1009/*!40101 SET character_set_client = utf8 */;
1010CREATE TABLE `shoes_tracks` (
1011 `id` int(11) NOT NULL AUTO_INCREMENT,
1012 `user_id` int(11) DEFAULT NULL,
1013 `staff_id` int(11) DEFAULT NULL,
1014 `ordered_at` date DEFAULT NULL,
1015 `delivered_at` date DEFAULT NULL,
1016 `item` varchar(255) DEFAULT NULL,
1017 `note` varchar(255) DEFAULT NULL,
1018 `list_type` varchar(255) DEFAULT NULL,
1019 `state` varchar(255) DEFAULT NULL,
1020 `created_at` datetime NOT NULL,
1021 `updated_at` datetime NOT NULL,
1022 PRIMARY KEY (`id`),
1023 KEY `index_shoes_tracks_on_user_id` (`user_id`),
1024 KEY `index_shoes_tracks_on_staff_id` (`staff_id`),
1025 CONSTRAINT `fk_rails_17e32cb48a` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
1026 CONSTRAINT `fk_rails_180feb85e0` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
1027) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1028/*!40101 SET character_set_client = @saved_cs_client */;
1029
1030--
1031-- Table structure for table `staff_group_managements`
1032--
1033
1034DROP TABLE IF EXISTS `staff_group_managements`;
1035/*!40101 SET @saved_cs_client = @@character_set_client */;
1036/*!40101 SET character_set_client = utf8 */;
1037CREATE TABLE `staff_group_managements` (
1038 `id` int(11) NOT NULL AUTO_INCREMENT,
1039 `staff_id` int(11) DEFAULT NULL,
1040 `group_id` int(11) DEFAULT NULL,
1041 `created_at` datetime NOT NULL,
1042 `updated_at` datetime NOT NULL,
1043 PRIMARY KEY (`id`),
1044 KEY `index_staff_group_managements_on_staff_id` (`staff_id`),
1045 KEY `index_staff_group_managements_on_group_id` (`group_id`)
1046) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
1047/*!40101 SET character_set_client = @saved_cs_client */;
1048
1049--
1050-- Table structure for table `staff_providers`
1051--
1052
1053DROP TABLE IF EXISTS `staff_providers`;
1054/*!40101 SET @saved_cs_client = @@character_set_client */;
1055/*!40101 SET character_set_client = utf8 */;
1056CREATE TABLE `staff_providers` (
1057 `id` int(11) NOT NULL AUTO_INCREMENT,
1058 `provider` varchar(255) DEFAULT NULL,
1059 `uid` varchar(255) DEFAULT NULL,
1060 `staff_id` int(11) DEFAULT NULL,
1061 `access_key` text,
1062 `refresh_token` varchar(255) DEFAULT NULL,
1063 `created_at` datetime NOT NULL,
1064 `updated_at` datetime NOT NULL,
1065 PRIMARY KEY (`id`),
1066 KEY `provider_default_index` (`staff_id`,`provider`,`uid`)
1067) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8;
1068/*!40101 SET character_set_client = @saved_cs_client */;
1069
1070--
1071-- Table structure for table `staff_ratings`
1072--
1073
1074DROP TABLE IF EXISTS `staff_ratings`;
1075/*!40101 SET @saved_cs_client = @@character_set_client */;
1076/*!40101 SET character_set_client = utf8 */;
1077CREATE TABLE `staff_ratings` (
1078 `id` int(11) NOT NULL AUTO_INCREMENT,
1079 `staff_id` int(11) DEFAULT NULL,
1080 `score` int(11) DEFAULT NULL,
1081 `comment` text,
1082 `created_at` datetime NOT NULL,
1083 `updated_at` datetime NOT NULL,
1084 PRIMARY KEY (`id`),
1085 KEY `index_staff_ratings_on_staff_id` (`staff_id`) USING BTREE
1086) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8;
1087/*!40101 SET character_set_client = @saved_cs_client */;
1088
1089--
1090-- Table structure for table `staff_user_managements`
1091--
1092
1093DROP TABLE IF EXISTS `staff_user_managements`;
1094/*!40101 SET @saved_cs_client = @@character_set_client */;
1095/*!40101 SET character_set_client = utf8 */;
1096CREATE TABLE `staff_user_managements` (
1097 `id` int(11) NOT NULL AUTO_INCREMENT,
1098 `staff_id` int(11) DEFAULT NULL,
1099 `user_id` int(11) DEFAULT NULL,
1100 `created_at` datetime NOT NULL,
1101 `updated_at` datetime NOT NULL,
1102 PRIMARY KEY (`id`),
1103 KEY `index_staff_user_managements_on_staff_id` (`staff_id`) USING BTREE,
1104 KEY `index_staff_user_managements_on_user_id` (`user_id`) USING BTREE
1105) ENGINE=InnoDB AUTO_INCREMENT=485 DEFAULT CHARSET=utf8;
1106/*!40101 SET character_set_client = @saved_cs_client */;
1107
1108--
1109-- Table structure for table `staffs`
1110--
1111
1112DROP TABLE IF EXISTS `staffs`;
1113/*!40101 SET @saved_cs_client = @@character_set_client */;
1114/*!40101 SET character_set_client = utf8 */;
1115CREATE TABLE `staffs` (
1116 `id` int(11) NOT NULL AUTO_INCREMENT,
1117 `email` varchar(255) DEFAULT NULL,
1118 `name` varchar(255) DEFAULT NULL,
1119 `phone` varchar(255) DEFAULT NULL,
1120 `provider` varchar(255) DEFAULT NULL,
1121 `uid` varchar(255) DEFAULT NULL,
1122 `image` varchar(255) DEFAULT NULL,
1123 `encrypted_password` varchar(255) DEFAULT NULL,
1124 `nickname` varchar(255) DEFAULT NULL,
1125 `sign_in_count` int(11) NOT NULL DEFAULT '0',
1126 `current_sign_in_at` datetime DEFAULT NULL,
1127 `last_sign_in_at` datetime DEFAULT NULL,
1128 `current_sign_in_ip` varchar(255) DEFAULT NULL,
1129 `last_sign_in_ip` varchar(255) DEFAULT NULL,
1130 `tokens` text,
1131 `google_token` varchar(255) DEFAULT NULL,
1132 `created_at` datetime NOT NULL,
1133 `updated_at` datetime NOT NULL,
1134 `district_group_id` int(11) DEFAULT NULL,
1135 PRIMARY KEY (`id`),
1136 KEY `index_staffs_on_district_group_id` (`district_group_id`),
1137 CONSTRAINT `fk_rails_3e69574990` FOREIGN KEY (`district_group_id`) REFERENCES `district_groups` (`id`)
1138) ENGINE=InnoDB AUTO_INCREMENT=103 DEFAULT CHARSET=utf8;
1139/*!40101 SET character_set_client = @saved_cs_client */;
1140
1141--
1142-- Table structure for table `staffs_roles`
1143--
1144
1145DROP TABLE IF EXISTS `staffs_roles`;
1146/*!40101 SET @saved_cs_client = @@character_set_client */;
1147/*!40101 SET character_set_client = utf8 */;
1148CREATE TABLE `staffs_roles` (
1149 `staff_id` int(11) DEFAULT NULL,
1150 `role_id` int(11) DEFAULT NULL,
1151 KEY `index_staffs_roles_on_staff_id_and_role_id` (`staff_id`,`role_id`) USING BTREE
1152) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1153/*!40101 SET character_set_client = @saved_cs_client */;
1154
1155--
1156-- Table structure for table `suit_tracks`
1157--
1158
1159DROP TABLE IF EXISTS `suit_tracks`;
1160/*!40101 SET @saved_cs_client = @@character_set_client */;
1161/*!40101 SET character_set_client = utf8 */;
1162CREATE TABLE `suit_tracks` (
1163 `id` int(11) NOT NULL AUTO_INCREMENT,
1164 `user_id` int(11) DEFAULT NULL,
1165 `staff_id` int(11) DEFAULT NULL,
1166 `ordered_at` date DEFAULT NULL,
1167 `delivered_at` date DEFAULT NULL,
1168 `item` varchar(255) DEFAULT NULL,
1169 `note` varchar(255) DEFAULT NULL,
1170 `list_type` varchar(255) DEFAULT NULL,
1171 `state` varchar(255) DEFAULT NULL,
1172 `created_at` datetime NOT NULL,
1173 `updated_at` datetime NOT NULL,
1174 PRIMARY KEY (`id`),
1175 KEY `index_suit_tracks_on_user_id` (`user_id`),
1176 KEY `index_suit_tracks_on_staff_id` (`staff_id`),
1177 CONSTRAINT `fk_rails_86222af1af` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
1178 CONSTRAINT `fk_rails_d36226c68c` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
1179) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
1180/*!40101 SET character_set_client = @saved_cs_client */;
1181
1182--
1183-- Table structure for table `tailor_works`
1184--
1185
1186DROP TABLE IF EXISTS `tailor_works`;
1187/*!40101 SET @saved_cs_client = @@character_set_client */;
1188/*!40101 SET character_set_client = utf8 */;
1189CREATE TABLE `tailor_works` (
1190 `id` int(11) NOT NULL AUTO_INCREMENT,
1191 `detail` json DEFAULT NULL,
1192 `staff_id` int(11) DEFAULT NULL,
1193 `team_id` int(11) DEFAULT NULL,
1194 `created_at` datetime NOT NULL,
1195 `updated_at` datetime NOT NULL,
1196 `suit_part` varchar(255) DEFAULT NULL,
1197 `title` varchar(255) DEFAULT NULL,
1198 `aasm_state` varchar(255) DEFAULT NULL,
1199 `print_file_name` varchar(255) DEFAULT NULL,
1200 `print_content_type` varchar(255) DEFAULT NULL,
1201 `print_file_size` int(11) DEFAULT NULL,
1202 `print_updated_at` datetime DEFAULT NULL,
1203 PRIMARY KEY (`id`),
1204 KEY `index_tailor_works_on_staff_id` (`staff_id`),
1205 KEY `index_tailor_works_on_team_id` (`team_id`),
1206 CONSTRAINT `fk_rails_abb7922ada` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`),
1207 CONSTRAINT `fk_rails_e804acbcba` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`)
1208) ENGINE=InnoDB AUTO_INCREMENT=288 DEFAULT CHARSET=utf8;
1209/*!40101 SET character_set_client = @saved_cs_client */;
1210
1211--
1212-- Table structure for table `team_calendars`
1213--
1214
1215DROP TABLE IF EXISTS `team_calendars`;
1216/*!40101 SET @saved_cs_client = @@character_set_client */;
1217/*!40101 SET character_set_client = utf8 */;
1218CREATE TABLE `team_calendars` (
1219 `id` int(11) NOT NULL AUTO_INCREMENT,
1220 `team_id` int(11) DEFAULT NULL,
1221 `category` varchar(255) DEFAULT NULL,
1222 `calendar_id` varchar(255) DEFAULT NULL,
1223 `created_at` datetime NOT NULL,
1224 `updated_at` datetime NOT NULL,
1225 PRIMARY KEY (`id`),
1226 KEY `index_team_calendars_on_team_id` (`team_id`)
1227) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=utf8;
1228/*!40101 SET character_set_client = @saved_cs_client */;
1229
1230--
1231-- Table structure for table `teams`
1232--
1233
1234DROP TABLE IF EXISTS `teams`;
1235/*!40101 SET @saved_cs_client = @@character_set_client */;
1236/*!40101 SET character_set_client = utf8 */;
1237CREATE TABLE `teams` (
1238 `id` int(11) NOT NULL AUTO_INCREMENT,
1239 `team_name` varchar(255) DEFAULT NULL,
1240 `calendar_id` varchar(255) DEFAULT NULL,
1241 `created_at` datetime NOT NULL,
1242 `updated_at` datetime NOT NULL,
1243 `role_id` int(11) DEFAULT NULL,
1244 PRIMARY KEY (`id`),
1245 KEY `index_teams_on_role_id` (`role_id`),
1246 CONSTRAINT `fk_rails_b202a9234c` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
1247) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
1248/*!40101 SET character_set_client = @saved_cs_client */;
1249
1250--
1251-- Table structure for table `thirdparty_companies`
1252--
1253
1254DROP TABLE IF EXISTS `thirdparty_companies`;
1255/*!40101 SET @saved_cs_client = @@character_set_client */;
1256/*!40101 SET character_set_client = utf8 */;
1257CREATE TABLE `thirdparty_companies` (
1258 `id` int(11) NOT NULL AUTO_INCREMENT,
1259 `title` varchar(255) DEFAULT NULL,
1260 `office_phone` varchar(255) DEFAULT NULL,
1261 `office_email` varchar(255) DEFAULT NULL,
1262 `person_in_charge_phone` varchar(255) DEFAULT NULL,
1263 `person_in_charge_name` varchar(255) DEFAULT NULL,
1264 `fee_percent` float DEFAULT NULL,
1265 `fax` varchar(255) DEFAULT NULL,
1266 `memo` text,
1267 `created_at` datetime NOT NULL,
1268 `updated_at` datetime NOT NULL,
1269 PRIMARY KEY (`id`)
1270) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
1271/*!40101 SET character_set_client = @saved_cs_client */;
1272
1273--
1274-- Table structure for table `user_attachments`
1275--
1276
1277DROP TABLE IF EXISTS `user_attachments`;
1278/*!40101 SET @saved_cs_client = @@character_set_client */;
1279/*!40101 SET character_set_client = utf8 */;
1280CREATE TABLE `user_attachments` (
1281 `id` int(11) NOT NULL AUTO_INCREMENT,
1282 `user_id` int(11) DEFAULT NULL,
1283 `created_at` datetime NOT NULL,
1284 `updated_at` datetime NOT NULL,
1285 `file_file_name` varchar(255) DEFAULT NULL,
1286 `file_content_type` varchar(255) DEFAULT NULL,
1287 `file_file_size` int(11) DEFAULT NULL,
1288 `file_updated_at` datetime DEFAULT NULL,
1289 PRIMARY KEY (`id`),
1290 KEY `index_user_attachments_on_user_id` (`user_id`) USING BTREE,
1291 CONSTRAINT `fk_rails_6f04cf5271` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
1292) ENGINE=InnoDB AUTO_INCREMENT=790 DEFAULT CHARSET=utf8;
1293/*!40101 SET character_set_client = @saved_cs_client */;
1294
1295--
1296-- Table structure for table `user_visit_appointments`
1297--
1298
1299DROP TABLE IF EXISTS `user_visit_appointments`;
1300/*!40101 SET @saved_cs_client = @@character_set_client */;
1301/*!40101 SET character_set_client = utf8 */;
1302CREATE TABLE `user_visit_appointments` (
1303 `id` int(11) NOT NULL AUTO_INCREMENT,
1304 `name` varchar(255) DEFAULT NULL,
1305 `phone` varchar(255) DEFAULT NULL,
1306 `email` varchar(255) DEFAULT NULL,
1307 `staff_id` int(11) DEFAULT NULL,
1308 `date` date DEFAULT NULL,
1309 `time` time DEFAULT NULL,
1310 `place` varchar(255) DEFAULT NULL,
1311 `created_at` datetime NOT NULL,
1312 `updated_at` datetime NOT NULL,
1313 `aasm_state` varchar(255) DEFAULT NULL,
1314 `event_id` varchar(255) DEFAULT NULL,
1315 `event_response` json DEFAULT NULL,
1316 `guid` varchar(255) DEFAULT NULL,
1317 `district_id` int(11) DEFAULT NULL,
1318 `new_user` varchar(255) DEFAULT 'new_user',
1319 PRIMARY KEY (`id`),
1320 KEY `index_user_visit_appointments_on_staff_id` (`staff_id`),
1321 KEY `index_user_visit_appointments_on_district_id` (`district_id`),
1322 CONSTRAINT `fk_rails_04ab575649` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`),
1323 CONSTRAINT `fk_rails_f84c639281` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`)
1324) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8;
1325/*!40101 SET character_set_client = @saved_cs_client */;
1326
1327--
1328-- Table structure for table `users`
1329--
1330
1331DROP TABLE IF EXISTS `users`;
1332/*!40101 SET @saved_cs_client = @@character_set_client */;
1333/*!40101 SET character_set_client = utf8 */;
1334CREATE TABLE `users` (
1335 `id` int(11) NOT NULL AUTO_INCREMENT,
1336 `email` varchar(255) NOT NULL DEFAULT '',
1337 `encrypted_password` varchar(255) NOT NULL DEFAULT '',
1338 `reset_password_token` varchar(255) DEFAULT NULL,
1339 `reset_password_sent_at` datetime DEFAULT NULL,
1340 `remember_created_at` datetime DEFAULT NULL,
1341 `sign_in_count` int(11) NOT NULL DEFAULT '0',
1342 `current_sign_in_at` datetime DEFAULT NULL,
1343 `last_sign_in_at` datetime DEFAULT NULL,
1344 `current_sign_in_ip` varchar(255) DEFAULT NULL,
1345 `last_sign_in_ip` varchar(255) DEFAULT NULL,
1346 `created_at` datetime NOT NULL,
1347 `updated_at` datetime NOT NULL,
1348 `name` varchar(255) DEFAULT NULL,
1349 `birth_date` date DEFAULT NULL,
1350 `memo` text,
1351 `phone` varchar(255) DEFAULT NULL,
1352 `age` int(11) DEFAULT NULL,
1353 `referral` json DEFAULT NULL,
1354 `consultant_result` json DEFAULT NULL,
1355 `image` varchar(255) DEFAULT NULL,
1356 `referrer` json DEFAULT NULL,
1357 `style_survey` json DEFAULT NULL,
1358 `avatar_file_name` varchar(255) DEFAULT NULL,
1359 `avatar_content_type` varchar(255) DEFAULT NULL,
1360 `avatar_file_size` int(11) DEFAULT NULL,
1361 `avatar_updated_at` datetime DEFAULT NULL,
1362 `accepted_terms` tinyint(1) DEFAULT '0',
1363 `group_id` int(11) DEFAULT NULL,
1364 `branch` varchar(255) DEFAULT NULL,
1365 `black_consumer` tinyint(1) DEFAULT '0',
1366 `sms_sent_at` datetime DEFAULT NULL,
1367 `aasm_state` varchar(255) DEFAULT NULL,
1368 `relation_person_name` varchar(255) DEFAULT NULL,
1369 `relation_person_phone` varchar(255) DEFAULT NULL,
1370 `relation_person_email` varchar(255) DEFAULT NULL,
1371 `payer_name` varchar(255) DEFAULT NULL,
1372 `thirdparty_company_id` int(11) DEFAULT NULL,
1373 `thirdparty_company_staff_name` varchar(255) DEFAULT NULL,
1374 `thirdparty_company_staff_phone` varchar(255) DEFAULT NULL,
1375 `contracted_at` date DEFAULT NULL,
1376 `wedding_at` date DEFAULT NULL,
1377 `rehearsal_at` date DEFAULT NULL,
1378 `delivered_at` date DEFAULT NULL,
1379 `wedding_location` varchar(255) DEFAULT NULL,
1380 `rehearsal_location` varchar(255) DEFAULT NULL,
1381 `local_consulted_at` datetime DEFAULT NULL,
1382 `local_consulting_memo` text,
1383 `list_type` varchar(255) DEFAULT NULL,
1384 PRIMARY KEY (`id`),
1385 UNIQUE KEY `index_users_on_email` (`email`) USING BTREE,
1386 UNIQUE KEY `index_users_on_reset_password_token` (`reset_password_token`) USING BTREE,
1387 KEY `index_users_on_group_id` (`group_id`),
1388 KEY `index_users_on_thirdparty_company_id` (`thirdparty_company_id`),
1389 KEY `index_users_on_contracted_at` (`contracted_at`),
1390 KEY `index_users_on_wedding_at` (`wedding_at`),
1391 KEY `index_users_on_rehearsal_at` (`rehearsal_at`),
1392 KEY `index_users_on_delivered_at` (`delivered_at`),
1393 KEY `index_users_on_name` (`name`),
1394 KEY `index_users_on_phone` (`phone`),
1395 KEY `index_users_on_relation_person_name` (`relation_person_name`),
1396 KEY `index_users_on_relation_person_phone` (`relation_person_phone`),
1397 KEY `index_users_on_payer_name` (`payer_name`),
1398 KEY `index_users_on_thirdparty_company_staff_name` (`thirdparty_company_staff_name`),
1399 KEY `index_users_on_thirdparty_company_staff_phone` (`thirdparty_company_staff_phone`),
1400 CONSTRAINT `fk_rails_47b2c8dc0b` FOREIGN KEY (`thirdparty_company_id`) REFERENCES `thirdparty_companies` (`id`),
1401 CONSTRAINT `fk_rails_f40b3f4da6` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`)
1402) ENGINE=InnoDB AUTO_INCREMENT=569 DEFAULT CHARSET=utf8;
1403/*!40101 SET character_set_client = @saved_cs_client */;
1404
1405--
1406-- Table structure for table `visit_appointment_addresses`
1407--
1408
1409DROP TABLE IF EXISTS `visit_appointment_addresses`;
1410/*!40101 SET @saved_cs_client = @@character_set_client */;
1411/*!40101 SET character_set_client = utf8 */;
1412CREATE TABLE `visit_appointment_addresses` (
1413 `id` int(11) NOT NULL AUTO_INCREMENT,
1414 `zipcode` varchar(255) DEFAULT NULL,
1415 `road_name` varchar(255) DEFAULT NULL,
1416 `detail` varchar(255) DEFAULT NULL,
1417 `user_visit_appointment_id` int(11) DEFAULT NULL,
1418 `created_at` datetime NOT NULL,
1419 `updated_at` datetime NOT NULL,
1420 PRIMARY KEY (`id`),
1421 KEY `index_visit_appointment_addresses_on_user_visit_appointment_id` (`user_visit_appointment_id`)
1422) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
1423/*!40101 SET character_set_client = @saved_cs_client */;
1424
1425--
1426-- Table structure for table `visit_appointment_comments`
1427--
1428
1429DROP TABLE IF EXISTS `visit_appointment_comments`;
1430/*!40101 SET @saved_cs_client = @@character_set_client */;
1431/*!40101 SET character_set_client = utf8 */;
1432CREATE TABLE `visit_appointment_comments` (
1433 `id` int(11) NOT NULL AUTO_INCREMENT,
1434 `content` text,
1435 `staff_id` int(11) DEFAULT NULL,
1436 `user_visit_appointment_id` int(11) DEFAULT NULL,
1437 `created_at` datetime NOT NULL,
1438 `updated_at` datetime NOT NULL,
1439 PRIMARY KEY (`id`),
1440 KEY `index_visit_appointment_comments_on_staff_id` (`staff_id`),
1441 KEY `index_visit_appointment_comments_on_user_visit_appointment_id` (`user_visit_appointment_id`)
1442) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8;
1443/*!40101 SET character_set_client = @saved_cs_client */;
1444
1445--
1446-- Table structure for table `wedding_orders`
1447--
1448
1449DROP TABLE IF EXISTS `wedding_orders`;
1450/*!40101 SET @saved_cs_client = @@character_set_client */;
1451/*!40101 SET character_set_client = utf8 */;
1452CREATE TABLE `wedding_orders` (
1453 `id` int(11) NOT NULL AUTO_INCREMENT,
1454 `user_id` int(11) DEFAULT NULL,
1455 `ordered_at` date DEFAULT NULL,
1456 `item` varchar(255) DEFAULT NULL,
1457 `note` varchar(255) DEFAULT NULL,
1458 `bespoke_suit` varchar(255) DEFAULT 'not_applicable',
1459 `tailoring_suit` varchar(255) DEFAULT 'not_applicable',
1460 `wedding_pack` varchar(255) DEFAULT 'not_applicable',
1461 `business_pack` varchar(255) DEFAULT 'not_applicable',
1462 `wedding_pack_jacket` int(11) DEFAULT '0',
1463 `wedding_pack_pants` int(11) DEFAULT '0',
1464 `wedding_pack_shirts` int(11) DEFAULT '0',
1465 `wedding_pack_shoes` int(11) DEFAULT '0',
1466 `business_pack_jacket` int(11) DEFAULT '0',
1467 `business_pack_pants` int(11) DEFAULT '0',
1468 `business_pack_shirts` int(11) DEFAULT '0',
1469 `business_pack_shoes` int(11) DEFAULT '0',
1470 `price` int(11) DEFAULT '0',
1471 `complimentary` varchar(255) DEFAULT 'not_applicable',
1472 `fee_percent` float DEFAULT '0',
1473 `fee_price` int(11) DEFAULT '0',
1474 `created_at` datetime NOT NULL,
1475 `updated_at` datetime NOT NULL,
1476 PRIMARY KEY (`id`),
1477 KEY `index_wedding_orders_on_user_id` (`user_id`),
1478 CONSTRAINT `fk_rails_dd0b4f5aab` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
1479) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
1480/*!40101 SET character_set_client = @saved_cs_client */;
1481
1482--
1483-- Table structure for table `wedding_payments`
1484--
1485
1486DROP TABLE IF EXISTS `wedding_payments`;
1487/*!40101 SET @saved_cs_client = @@character_set_client */;
1488/*!40101 SET character_set_client = utf8 */;
1489CREATE TABLE `wedding_payments` (
1490 `id` int(11) NOT NULL AUTO_INCREMENT,
1491 `user_id` int(11) DEFAULT NULL,
1492 `pay_count` varchar(255) DEFAULT NULL,
1493 `pay_method` varchar(255) DEFAULT NULL,
1494 `state` varchar(255) DEFAULT 'paying',
1495 `paid_at` date DEFAULT NULL,
1496 `price` int(11) DEFAULT '0',
1497 `note` text,
1498 `created_at` datetime NOT NULL,
1499 `updated_at` datetime NOT NULL,
1500 PRIMARY KEY (`id`),
1501 KEY `index_wedding_payments_on_user_id` (`user_id`),
1502 CONSTRAINT `fk_rails_80b280b793` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
1503) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
1504/*!40101 SET character_set_client = @saved_cs_client */;
1505/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1506
1507/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1508/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1509/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1510/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1511/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1512/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1513/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1514
1515-- Dump completed on 2019-04-23 8:21:31