· 8 years ago · Feb 09, 2018, 03:04 PM
1-- --------------------------------------------------------
2-- Host: 127.0.0.1
3-- Server versie: 10.1.30-MariaDB - mariadb.org binary distribution
4-- Server OS: Win32
5-- HeidiSQL Versie: 9.5.0.5196
6-- --------------------------------------------------------
7
8/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
9/*!40101 SET NAMES utf8 */;
10/*!50503 SET NAMES utf8mb4 */;
11/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
12/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
13
14-- Structuur van tabel risa.checklists wordt geschreven
15CREATE TABLE IF NOT EXISTS `checklists` (
16 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
17 `user_id` int(10) unsigned NOT NULL,
18 `convoy_id` int(10) unsigned NOT NULL,
19 `status` int(11) NOT NULL,
20 `created_at` timestamp NULL DEFAULT NULL,
21 `updated_at` timestamp NULL DEFAULT NULL,
22 PRIMARY KEY (`id`),
23 KEY `checklists_user_id_foreign` (`user_id`),
24 KEY `checklists_convoy_id_foreign` (`convoy_id`),
25 CONSTRAINT `checklists_convoy_id_foreign` FOREIGN KEY (`convoy_id`) REFERENCES `convoys` (`id`),
26 CONSTRAINT `checklists_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
27) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
28
29-- Data exporteren was gedeselecteerd
30-- Structuur van tabel risa.cities wordt geschreven
31CREATE TABLE IF NOT EXISTS `cities` (
32 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
33 `city` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
34 `created_at` timestamp NULL DEFAULT NULL,
35 `updated_at` timestamp NULL DEFAULT NULL,
36 PRIMARY KEY (`id`)
37) ENGINE=InnoDB AUTO_INCREMENT=153 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
38
39-- Data exporteren was gedeselecteerd
40-- Structuur van tabel risa.companies wordt geschreven
41CREATE TABLE IF NOT EXISTS `companies` (
42 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
43 `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
44 `created_at` timestamp NULL DEFAULT NULL,
45 `updated_at` timestamp NULL DEFAULT NULL,
46 PRIMARY KEY (`id`)
47) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
48
49-- Data exporteren was gedeselecteerd
50-- Structuur van tabel risa.convoys wordt geschreven
51CREATE TABLE IF NOT EXISTS `convoys` (
52 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
53 `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
54 `body` text COLLATE utf8mb4_unicode_ci NOT NULL,
55 `category` int(11) NOT NULL,
56 `start_date` date NOT NULL,
57 `meeting_time` time NOT NULL,
58 `start_time` time NOT NULL,
59 `end_time` time NOT NULL,
60 `server` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
61 `start_city` int(10) unsigned NOT NULL,
62 `end_city` int(10) unsigned NOT NULL,
63 `start_company` int(10) unsigned NOT NULL,
64 `end_company` int(10) unsigned NOT NULL,
65 `tour_photo` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
66 `end_date` timestamp NULL DEFAULT NULL,
67 `created_at` timestamp NULL DEFAULT NULL,
68 `updated_at` timestamp NULL DEFAULT NULL,
69 PRIMARY KEY (`id`),
70 KEY `convoys_start_city_foreign` (`start_city`),
71 KEY `convoys_end_city_foreign` (`end_city`),
72 KEY `convoys_start_company_foreign` (`start_company`),
73 KEY `convoys_end_company_foreign` (`end_company`),
74 CONSTRAINT `convoys_end_city_foreign` FOREIGN KEY (`end_city`) REFERENCES `cities` (`id`),
75 CONSTRAINT `convoys_end_company_foreign` FOREIGN KEY (`end_company`) REFERENCES `companies` (`id`),
76 CONSTRAINT `convoys_start_city_foreign` FOREIGN KEY (`start_city`) REFERENCES `cities` (`id`),
77 CONSTRAINT `convoys_start_company_foreign` FOREIGN KEY (`start_company`) REFERENCES `companies` (`id`)
78) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
79
80-- Data exporteren was gedeselecteerd
81-- Structuur van tabel risa.migrations wordt geschreven
82CREATE TABLE IF NOT EXISTS `migrations` (
83 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
84 `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
85 `batch` int(11) NOT NULL,
86 PRIMARY KEY (`id`)
87) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
88
89-- Data exporteren was gedeselecteerd
90-- Structuur van tabel risa.password_resets wordt geschreven
91CREATE TABLE IF NOT EXISTS `password_resets` (
92 `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
93 `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
94 `created_at` timestamp NULL DEFAULT NULL,
95 KEY `password_resets_email_index` (`email`)
96) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
97
98-- Data exporteren was gedeselecteerd
99-- Structuur van tabel risa.points wordt geschreven
100CREATE TABLE IF NOT EXISTS `points` (
101 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
102 `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
103 `points` int(11) NOT NULL,
104 `created_at` timestamp NULL DEFAULT NULL,
105 `updated_at` timestamp NULL DEFAULT NULL,
106 PRIMARY KEY (`id`)
107) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
108
109-- Data exporteren was gedeselecteerd
110-- Structuur van tabel risa.users wordt geschreven
111CREATE TABLE IF NOT EXISTS `users` (
112 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
113 `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
114 `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
115 `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
116 `type` int(11) NOT NULL DEFAULT '0',
117 `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
118 `created_at` timestamp NULL DEFAULT NULL,
119 `updated_at` timestamp NULL DEFAULT NULL,
120 PRIMARY KEY (`id`),
121 UNIQUE KEY `users_name_unique` (`name`)
122) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
123
124-- Data exporteren was gedeselecteerd
125-- Structuur van tabel risa.user_points wordt geschreven
126CREATE TABLE IF NOT EXISTS `user_points` (
127 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
128 `user_id` int(10) unsigned NOT NULL,
129 `point_id` int(10) unsigned NOT NULL,
130 `added_by` int(10) unsigned NOT NULL,
131 `created_at` timestamp NULL DEFAULT NULL,
132 `updated_at` timestamp NULL DEFAULT NULL,
133 PRIMARY KEY (`id`),
134 KEY `user_points_user_id_foreign` (`user_id`),
135 KEY `user_points_point_id_foreign` (`point_id`),
136 KEY `user_points_added_by_foreign` (`added_by`),
137 CONSTRAINT `user_points_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
138 CONSTRAINT `user_points_point_id_foreign` FOREIGN KEY (`point_id`) REFERENCES `points` (`id`) ON DELETE CASCADE,
139 CONSTRAINT `user_points_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
140) ENGINE=InnoDB AUTO_INCREMENT=103 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
141
142-- Data exporteren was gedeselecteerd
143/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
144/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
145/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;