Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 62.26 KB | None | 0 0
  1. CREATE DATABASE IF NOT EXISTS `smartbuilding` /*!40100 DEFAULT CHARACTER SET utf8 */;
  2. USE `smartbuilding`;
  3. -- MySQL dump 10.13 Distrib 5.5.41, for debian-linux-gnu (i686)
  4. --
  5. -- Host: localhost Database: smartbuilding
  6. -- ------------------------------------------------------
  7. -- Server version 5.5.41-0ubuntu0.12.04.1
  8.  
  9. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  10. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  11. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  12. /*!40101 SET NAMES utf8 */;
  13. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  14. /*!40103 SET TIME_ZONE='+00:00' */;
  15. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  16. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  17. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  18. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  19.  
  20. --
  21. -- Table structure for table `amenities`
  22. --
  23.  
  24. DROP TABLE IF EXISTS `amenities`;
  25. /*!40101 SET @saved_cs_client = @@character_set_client */;
  26. /*!40101 SET character_set_client = utf8 */;
  27. CREATE TABLE `amenities` (
  28. `id` int(11) NOT NULL,
  29. `name` varchar(45) DEFAULT NULL,
  30. `description` longtext,
  31. `time_limit` int(11) DEFAULT NULL,
  32. PRIMARY KEY (`id`)
  33. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  34. /*!40101 SET character_set_client = @saved_cs_client */;
  35.  
  36. --
  37. -- Dumping data for table `amenities`
  38. --
  39.  
  40. LOCK TABLES `amenities` WRITE;
  41. /*!40000 ALTER TABLE `amenities` DISABLE KEYS */;
  42. /*!40000 ALTER TABLE `amenities` ENABLE KEYS */;
  43. UNLOCK TABLES;
  44.  
  45. --
  46. -- Table structure for table `amenity_booking_statuses`
  47. --
  48.  
  49. DROP TABLE IF EXISTS `amenity_booking_statuses`;
  50. /*!40101 SET @saved_cs_client = @@character_set_client */;
  51. /*!40101 SET character_set_client = utf8 */;
  52. CREATE TABLE `amenity_booking_statuses` (
  53. `id` int(11) NOT NULL,
  54. `status_name` varchar(45) DEFAULT NULL,
  55. PRIMARY KEY (`id`)
  56. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  57. /*!40101 SET character_set_client = @saved_cs_client */;
  58.  
  59. --
  60. -- Dumping data for table `amenity_booking_statuses`
  61. --
  62.  
  63. LOCK TABLES `amenity_booking_statuses` WRITE;
  64. /*!40000 ALTER TABLE `amenity_booking_statuses` DISABLE KEYS */;
  65. /*!40000 ALTER TABLE `amenity_booking_statuses` ENABLE KEYS */;
  66. UNLOCK TABLES;
  67.  
  68. --
  69. -- Table structure for table `amenity_bookings`
  70. --
  71.  
  72. DROP TABLE IF EXISTS `amenity_bookings`;
  73. /*!40101 SET @saved_cs_client = @@character_set_client */;
  74. /*!40101 SET character_set_client = utf8 */;
  75. CREATE TABLE `amenity_bookings` (
  76. `id` int(11) NOT NULL,
  77. `amenity_id` int(11) DEFAULT NULL,
  78. `booking_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  79. `start_time` datetime NOT NULL,
  80. `end_time` datetime NOT NULL,
  81. `additional_notes` text,
  82. `user_id` int(11) DEFAULT NULL,
  83. `amenity_booking_status_id` int(11) DEFAULT NULL,
  84. PRIMARY KEY (`id`),
  85. KEY `fk_amenity_bookings_1_idx` (`user_id`),
  86. KEY `fk_amenity_bookings_2_idx` (`amenity_booking_status_id`),
  87. CONSTRAINT `fk_amenity_bookings_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  88. CONSTRAINT `fk_amenity_bookings_2` FOREIGN KEY (`amenity_booking_status_id`) REFERENCES `amenity_booking_statuses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  89. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  90. /*!40101 SET character_set_client = @saved_cs_client */;
  91.  
  92. --
  93. -- Dumping data for table `amenity_bookings`
  94. --
  95.  
  96. LOCK TABLES `amenity_bookings` WRITE;
  97. /*!40000 ALTER TABLE `amenity_bookings` DISABLE KEYS */;
  98. /*!40000 ALTER TABLE `amenity_bookings` ENABLE KEYS */;
  99. UNLOCK TABLES;
  100.  
  101. --
  102. -- Table structure for table `amenity_gallery`
  103. --
  104.  
  105. DROP TABLE IF EXISTS `amenity_gallery`;
  106. /*!40101 SET @saved_cs_client = @@character_set_client */;
  107. /*!40101 SET character_set_client = utf8 */;
  108. CREATE TABLE `amenity_gallery` (
  109. `id` int(11) NOT NULL,
  110. `amenity_id` int(11) DEFAULT NULL,
  111. `img_path` varchar(45) DEFAULT NULL,
  112. PRIMARY KEY (`id`),
  113. KEY `fk_amenity_gallery_1_idx` (`amenity_id`),
  114. CONSTRAINT `fk_amenity_gallery_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  115. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  116. /*!40101 SET character_set_client = @saved_cs_client */;
  117.  
  118. --
  119. -- Dumping data for table `amenity_gallery`
  120. --
  121.  
  122. LOCK TABLES `amenity_gallery` WRITE;
  123. /*!40000 ALTER TABLE `amenity_gallery` DISABLE KEYS */;
  124. /*!40000 ALTER TABLE `amenity_gallery` ENABLE KEYS */;
  125. UNLOCK TABLES;
  126.  
  127. --
  128. -- Table structure for table `amenity_schedule_friday`
  129. --
  130.  
  131. DROP TABLE IF EXISTS `amenity_schedule_friday`;
  132. /*!40101 SET @saved_cs_client = @@character_set_client */;
  133. /*!40101 SET character_set_client = utf8 */;
  134. CREATE TABLE `amenity_schedule_friday` (
  135. `id` int(11) NOT NULL,
  136. `amenity_id` int(11) DEFAULT NULL,
  137. `opening_time` time DEFAULT NULL,
  138. `closing_time` time DEFAULT NULL,
  139. PRIMARY KEY (`id`),
  140. KEY `fk_amenity_schedule_friday_1_idx` (`amenity_id`),
  141. CONSTRAINT `fk_amenity_schedule_friday_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  142. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  143. /*!40101 SET character_set_client = @saved_cs_client */;
  144.  
  145. --
  146. -- Dumping data for table `amenity_schedule_friday`
  147. --
  148.  
  149. LOCK TABLES `amenity_schedule_friday` WRITE;
  150. /*!40000 ALTER TABLE `amenity_schedule_friday` DISABLE KEYS */;
  151. /*!40000 ALTER TABLE `amenity_schedule_friday` ENABLE KEYS */;
  152. UNLOCK TABLES;
  153.  
  154. --
  155. -- Table structure for table `amenity_schedule_monday`
  156. --
  157.  
  158. DROP TABLE IF EXISTS `amenity_schedule_monday`;
  159. /*!40101 SET @saved_cs_client = @@character_set_client */;
  160. /*!40101 SET character_set_client = utf8 */;
  161. CREATE TABLE `amenity_schedule_monday` (
  162. `id` int(11) NOT NULL,
  163. `amenity_id` int(11) DEFAULT NULL,
  164. `opening_time` time DEFAULT NULL,
  165. `closing_time` time DEFAULT NULL,
  166. PRIMARY KEY (`id`),
  167. KEY `fk_amenity_schedule_monday_1_idx` (`amenity_id`),
  168. CONSTRAINT `fk_amenity_schedule_monday_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  169. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  170. /*!40101 SET character_set_client = @saved_cs_client */;
  171.  
  172. --
  173. -- Dumping data for table `amenity_schedule_monday`
  174. --
  175.  
  176. LOCK TABLES `amenity_schedule_monday` WRITE;
  177. /*!40000 ALTER TABLE `amenity_schedule_monday` DISABLE KEYS */;
  178. /*!40000 ALTER TABLE `amenity_schedule_monday` ENABLE KEYS */;
  179. UNLOCK TABLES;
  180.  
  181. --
  182. -- Table structure for table `amenity_schedule_saturday`
  183. --
  184.  
  185. DROP TABLE IF EXISTS `amenity_schedule_saturday`;
  186. /*!40101 SET @saved_cs_client = @@character_set_client */;
  187. /*!40101 SET character_set_client = utf8 */;
  188. CREATE TABLE `amenity_schedule_saturday` (
  189. `id` int(11) NOT NULL,
  190. `amenity_id` int(11) DEFAULT NULL,
  191. `opening_time` time DEFAULT NULL,
  192. `closing_time` time DEFAULT NULL,
  193. PRIMARY KEY (`id`),
  194. KEY `fk_amenity_schedule_saturday_1_idx` (`amenity_id`),
  195. CONSTRAINT `fk_amenity_schedule_saturday_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  196. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  197. /*!40101 SET character_set_client = @saved_cs_client */;
  198.  
  199. --
  200. -- Dumping data for table `amenity_schedule_saturday`
  201. --
  202.  
  203. LOCK TABLES `amenity_schedule_saturday` WRITE;
  204. /*!40000 ALTER TABLE `amenity_schedule_saturday` DISABLE KEYS */;
  205. /*!40000 ALTER TABLE `amenity_schedule_saturday` ENABLE KEYS */;
  206. UNLOCK TABLES;
  207.  
  208. --
  209. -- Table structure for table `amenity_schedule_sunday`
  210. --
  211.  
  212. DROP TABLE IF EXISTS `amenity_schedule_sunday`;
  213. /*!40101 SET @saved_cs_client = @@character_set_client */;
  214. /*!40101 SET character_set_client = utf8 */;
  215. CREATE TABLE `amenity_schedule_sunday` (
  216. `id` int(11) NOT NULL,
  217. `amenity_id` int(11) DEFAULT NULL,
  218. `opening_time` time DEFAULT NULL,
  219. `closing_time` time DEFAULT NULL,
  220. PRIMARY KEY (`id`),
  221. KEY `fk_amenity_schedule_sunday_1_idx` (`amenity_id`),
  222. CONSTRAINT `fk_amenity_schedule_sunday_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  223. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  224. /*!40101 SET character_set_client = @saved_cs_client */;
  225.  
  226. --
  227. -- Dumping data for table `amenity_schedule_sunday`
  228. --
  229.  
  230. LOCK TABLES `amenity_schedule_sunday` WRITE;
  231. /*!40000 ALTER TABLE `amenity_schedule_sunday` DISABLE KEYS */;
  232. /*!40000 ALTER TABLE `amenity_schedule_sunday` ENABLE KEYS */;
  233. UNLOCK TABLES;
  234.  
  235. --
  236. -- Table structure for table `amenity_schedule_thursday`
  237. --
  238.  
  239. DROP TABLE IF EXISTS `amenity_schedule_thursday`;
  240. /*!40101 SET @saved_cs_client = @@character_set_client */;
  241. /*!40101 SET character_set_client = utf8 */;
  242. CREATE TABLE `amenity_schedule_thursday` (
  243. `id` int(11) NOT NULL,
  244. `amenity_id` int(11) DEFAULT NULL,
  245. `opening_time` time DEFAULT NULL,
  246. `closing_time` time DEFAULT NULL,
  247. PRIMARY KEY (`id`),
  248. KEY `fk_amenity_schedule_thursday_1_idx` (`amenity_id`),
  249. CONSTRAINT `fk_amenity_schedule_thursday_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  250. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  251. /*!40101 SET character_set_client = @saved_cs_client */;
  252.  
  253. --
  254. -- Dumping data for table `amenity_schedule_thursday`
  255. --
  256.  
  257. LOCK TABLES `amenity_schedule_thursday` WRITE;
  258. /*!40000 ALTER TABLE `amenity_schedule_thursday` DISABLE KEYS */;
  259. /*!40000 ALTER TABLE `amenity_schedule_thursday` ENABLE KEYS */;
  260. UNLOCK TABLES;
  261.  
  262. --
  263. -- Table structure for table `amenity_schedule_tuesday`
  264. --
  265.  
  266. DROP TABLE IF EXISTS `amenity_schedule_tuesday`;
  267. /*!40101 SET @saved_cs_client = @@character_set_client */;
  268. /*!40101 SET character_set_client = utf8 */;
  269. CREATE TABLE `amenity_schedule_tuesday` (
  270. `id` int(11) NOT NULL,
  271. `amenity_id` int(11) DEFAULT NULL,
  272. `opening_time` time DEFAULT NULL,
  273. `closing_time` time DEFAULT NULL,
  274. PRIMARY KEY (`id`),
  275. KEY `fk_amenity_schedule_tuesday_1_idx` (`amenity_id`),
  276. CONSTRAINT `fk_amenity_schedule_tuesday_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  277. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  278. /*!40101 SET character_set_client = @saved_cs_client */;
  279.  
  280. --
  281. -- Dumping data for table `amenity_schedule_tuesday`
  282. --
  283.  
  284. LOCK TABLES `amenity_schedule_tuesday` WRITE;
  285. /*!40000 ALTER TABLE `amenity_schedule_tuesday` DISABLE KEYS */;
  286. /*!40000 ALTER TABLE `amenity_schedule_tuesday` ENABLE KEYS */;
  287. UNLOCK TABLES;
  288.  
  289. --
  290. -- Table structure for table `amenity_schedule_wednesday`
  291. --
  292.  
  293. DROP TABLE IF EXISTS `amenity_schedule_wednesday`;
  294. /*!40101 SET @saved_cs_client = @@character_set_client */;
  295. /*!40101 SET character_set_client = utf8 */;
  296. CREATE TABLE `amenity_schedule_wednesday` (
  297. `id` int(11) NOT NULL,
  298. `amenity_id` int(11) DEFAULT NULL,
  299. `opening_time` time DEFAULT NULL,
  300. `closing_time` time DEFAULT NULL,
  301. PRIMARY KEY (`id`),
  302. KEY `fk_amenity_schedule_wednesday_1_idx` (`amenity_id`),
  303. CONSTRAINT `fk_amenity_schedule_wednesday_1` FOREIGN KEY (`amenity_id`) REFERENCES `amenities` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  304. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  305. /*!40101 SET character_set_client = @saved_cs_client */;
  306.  
  307. --
  308. -- Dumping data for table `amenity_schedule_wednesday`
  309. --
  310.  
  311. LOCK TABLES `amenity_schedule_wednesday` WRITE;
  312. /*!40000 ALTER TABLE `amenity_schedule_wednesday` DISABLE KEYS */;
  313. /*!40000 ALTER TABLE `amenity_schedule_wednesday` ENABLE KEYS */;
  314. UNLOCK TABLES;
  315.  
  316. --
  317. -- Table structure for table `announcements`
  318. --
  319.  
  320. DROP TABLE IF EXISTS `announcements`;
  321. /*!40101 SET @saved_cs_client = @@character_set_client */;
  322. /*!40101 SET character_set_client = utf8 */;
  323. CREATE TABLE `announcements` (
  324. `id` int(11) NOT NULL AUTO_INCREMENT,
  325. `title` varchar(45) DEFAULT NULL,
  326. `details` longtext,
  327. `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  328. `building_id` int(11) DEFAULT NULL,
  329. `user_id` int(11) DEFAULT NULL,
  330. `accessible_to_residents` tinyint(1) DEFAULT NULL,
  331. PRIMARY KEY (`id`),
  332. KEY `fk_announcements_1_idx` (`building_id`),
  333. KEY `fk_announcements_2_idx` (`user_id`),
  334. CONSTRAINT `fk_announcements_1` FOREIGN KEY (`building_id`) REFERENCES `buildings` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  335. CONSTRAINT `fk_announcements_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  336. ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
  337. /*!40101 SET character_set_client = @saved_cs_client */;
  338.  
  339. --
  340. -- Dumping data for table `announcements`
  341. --
  342.  
  343. LOCK TABLES `announcements` WRITE;
  344. /*!40000 ALTER TABLE `announcements` DISABLE KEYS */;
  345. INSERT INTO `announcements` VALUES (1,'New Carpets on Floor 5','All carpets on floor 5 will be replaced on March 6th 9am - 5pm','2015-04-14 13:41:11',1,17,1),(2,'Water Outage','There will be a water outage for the entire building on March 4th 9am - 5pm. Remember to stock up!','2015-04-14 13:42:11',1,17,1),(3,'Window Changes - Floor 3','All Windows on Floor 3 will be replaced tomorrow at noon','2015-04-13 15:45:46',1,17,1),(4,'Window Changes - Floor 4','All Windows on Floor 4 will be replaced tomorrow at noon','2015-04-13 15:46:46',1,17,1),(5,'Window Changes - Floor 5','All Windows on Floor 5 will be replaced tomorrow at noon','2015-04-13 15:47:46',1,17,0),(6,'Window Changes - Floor 6','All Windows on Floor 6 will be replaced tomorrow at noon','2015-04-13 15:48:46',1,17,1),(7,'Window Changes - Floor 7','All Windows on Floor 7 will be replaced tomorrow at noon','2015-04-13 15:49:46',1,17,1);
  346. /*!40000 ALTER TABLE `announcements` ENABLE KEYS */;
  347. UNLOCK TABLES;
  348.  
  349. --
  350. -- Table structure for table `bike_assignment_statuses`
  351. --
  352.  
  353. DROP TABLE IF EXISTS `bike_assignment_statuses`;
  354. /*!40101 SET @saved_cs_client = @@character_set_client */;
  355. /*!40101 SET character_set_client = utf8 */;
  356. CREATE TABLE `bike_assignment_statuses` (
  357. `id` int(11) NOT NULL,
  358. `status_name` varchar(45) DEFAULT NULL,
  359. PRIMARY KEY (`id`)
  360. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  361. /*!40101 SET character_set_client = @saved_cs_client */;
  362.  
  363. --
  364. -- Dumping data for table `bike_assignment_statuses`
  365. --
  366.  
  367. LOCK TABLES `bike_assignment_statuses` WRITE;
  368. /*!40000 ALTER TABLE `bike_assignment_statuses` DISABLE KEYS */;
  369. /*!40000 ALTER TABLE `bike_assignment_statuses` ENABLE KEYS */;
  370. UNLOCK TABLES;
  371.  
  372. --
  373. -- Table structure for table `bike_assignments`
  374. --
  375.  
  376. DROP TABLE IF EXISTS `bike_assignments`;
  377. /*!40101 SET @saved_cs_client = @@character_set_client */;
  378. /*!40101 SET character_set_client = utf8 */;
  379. CREATE TABLE `bike_assignments` (
  380. `id` int(11) NOT NULL,
  381. `bike_id` int(11) DEFAULT NULL,
  382. `bike_storage_id` int(11) DEFAULT NULL,
  383. `assignment_status_id` int(11) DEFAULT NULL,
  384. PRIMARY KEY (`id`),
  385. KEY `fk_bike_assignments_1_idx` (`bike_id`),
  386. KEY `fk_bike_assignments_2_idx` (`bike_storage_id`),
  387. KEY `fk_bike_assignments_3_idx` (`assignment_status_id`),
  388. CONSTRAINT `fk_bike_assignments_1` FOREIGN KEY (`bike_id`) REFERENCES `bikes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  389. CONSTRAINT `fk_bike_assignments_2` FOREIGN KEY (`bike_storage_id`) REFERENCES `bike_storages` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  390. CONSTRAINT `fk_bike_assignments_3` FOREIGN KEY (`assignment_status_id`) REFERENCES `bike_assignment_statuses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  391. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  392. /*!40101 SET character_set_client = @saved_cs_client */;
  393.  
  394. --
  395. -- Dumping data for table `bike_assignments`
  396. --
  397.  
  398. LOCK TABLES `bike_assignments` WRITE;
  399. /*!40000 ALTER TABLE `bike_assignments` DISABLE KEYS */;
  400. /*!40000 ALTER TABLE `bike_assignments` ENABLE KEYS */;
  401. UNLOCK TABLES;
  402.  
  403. --
  404. -- Table structure for table `bike_images`
  405. --
  406.  
  407. DROP TABLE IF EXISTS `bike_images`;
  408. /*!40101 SET @saved_cs_client = @@character_set_client */;
  409. /*!40101 SET character_set_client = utf8 */;
  410. CREATE TABLE `bike_images` (
  411. `id` int(11) NOT NULL,
  412. `bike_id` int(11) DEFAULT NULL,
  413. `img_path` varchar(145) DEFAULT NULL,
  414. PRIMARY KEY (`id`),
  415. KEY `fk_bike_images_1_idx` (`bike_id`),
  416. CONSTRAINT `fk_bike_images_1` FOREIGN KEY (`bike_id`) REFERENCES `bikes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  417. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  418. /*!40101 SET character_set_client = @saved_cs_client */;
  419.  
  420. --
  421. -- Dumping data for table `bike_images`
  422. --
  423.  
  424. LOCK TABLES `bike_images` WRITE;
  425. /*!40000 ALTER TABLE `bike_images` DISABLE KEYS */;
  426. /*!40000 ALTER TABLE `bike_images` ENABLE KEYS */;
  427. UNLOCK TABLES;
  428.  
  429. --
  430. -- Table structure for table `bike_storage_locations`
  431. --
  432.  
  433. DROP TABLE IF EXISTS `bike_storage_locations`;
  434. /*!40101 SET @saved_cs_client = @@character_set_client */;
  435. /*!40101 SET character_set_client = utf8 */;
  436. CREATE TABLE `bike_storage_locations` (
  437. `id` int(11) NOT NULL,
  438. `location_name` varchar(45) DEFAULT NULL,
  439. PRIMARY KEY (`id`)
  440. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  441. /*!40101 SET character_set_client = @saved_cs_client */;
  442.  
  443. --
  444. -- Dumping data for table `bike_storage_locations`
  445. --
  446.  
  447. LOCK TABLES `bike_storage_locations` WRITE;
  448. /*!40000 ALTER TABLE `bike_storage_locations` DISABLE KEYS */;
  449. /*!40000 ALTER TABLE `bike_storage_locations` ENABLE KEYS */;
  450. UNLOCK TABLES;
  451.  
  452. --
  453. -- Table structure for table `bike_storages`
  454. --
  455.  
  456. DROP TABLE IF EXISTS `bike_storages`;
  457. /*!40101 SET @saved_cs_client = @@character_set_client */;
  458. /*!40101 SET character_set_client = utf8 */;
  459. CREATE TABLE `bike_storages` (
  460. `id` int(11) NOT NULL,
  461. `storage_number` varchar(45) DEFAULT NULL,
  462. `bike_storage_location_id` int(11) DEFAULT NULL,
  463. PRIMARY KEY (`id`),
  464. KEY `fk_bike_storages_1_idx` (`bike_storage_location_id`),
  465. CONSTRAINT `fk_bike_storages_1` FOREIGN KEY (`bike_storage_location_id`) REFERENCES `bike_storage_locations` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  466. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  467. /*!40101 SET character_set_client = @saved_cs_client */;
  468.  
  469. --
  470. -- Dumping data for table `bike_storages`
  471. --
  472.  
  473. LOCK TABLES `bike_storages` WRITE;
  474. /*!40000 ALTER TABLE `bike_storages` DISABLE KEYS */;
  475. /*!40000 ALTER TABLE `bike_storages` ENABLE KEYS */;
  476. UNLOCK TABLES;
  477.  
  478. --
  479. -- Table structure for table `bikes`
  480. --
  481.  
  482. DROP TABLE IF EXISTS `bikes`;
  483. /*!40101 SET @saved_cs_client = @@character_set_client */;
  484. /*!40101 SET character_set_client = utf8 */;
  485. CREATE TABLE `bikes` (
  486. `id` int(11) NOT NULL,
  487. `name` varchar(45) DEFAULT NULL,
  488. `make` varchar(45) DEFAULT NULL,
  489. `model` varchar(45) DEFAULT NULL,
  490. `year` varchar(45) DEFAULT NULL,
  491. `user_id` int(11) DEFAULT NULL,
  492. PRIMARY KEY (`id`),
  493. KEY `fk_bikes_1_idx` (`user_id`),
  494. CONSTRAINT `fk_bikes_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  495. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  496. /*!40101 SET character_set_client = @saved_cs_client */;
  497.  
  498. --
  499. -- Dumping data for table `bikes`
  500. --
  501.  
  502. LOCK TABLES `bikes` WRITE;
  503. /*!40000 ALTER TABLE `bikes` DISABLE KEYS */;
  504. /*!40000 ALTER TABLE `bikes` ENABLE KEYS */;
  505. UNLOCK TABLES;
  506.  
  507. --
  508. -- Table structure for table `building_licensed_app_functions`
  509. --
  510.  
  511. DROP TABLE IF EXISTS `building_licensed_app_functions`;
  512. /*!40101 SET @saved_cs_client = @@character_set_client */;
  513. /*!40101 SET character_set_client = utf8 */;
  514. CREATE TABLE `building_licensed_app_functions` (
  515. `id` int(11) NOT NULL,
  516. `building_licensed_app_id` int(11) DEFAULT NULL,
  517. `licensed_app_function_id` int(11) DEFAULT NULL,
  518. PRIMARY KEY (`id`),
  519. KEY `fk_building_licensed_app_functions_1_idx` (`building_licensed_app_id`),
  520. KEY `fk_building_licensed_app_functions_2_idx` (`licensed_app_function_id`),
  521. CONSTRAINT `fk_building_licensed_app_functions_1` FOREIGN KEY (`building_licensed_app_id`) REFERENCES `building_licensed_apps` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  522. CONSTRAINT `fk_building_licensed_app_functions_2` FOREIGN KEY (`licensed_app_function_id`) REFERENCES `licensed_app_functions` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  523. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  524. /*!40101 SET character_set_client = @saved_cs_client */;
  525.  
  526. --
  527. -- Dumping data for table `building_licensed_app_functions`
  528. --
  529.  
  530. LOCK TABLES `building_licensed_app_functions` WRITE;
  531. /*!40000 ALTER TABLE `building_licensed_app_functions` DISABLE KEYS */;
  532. /*!40000 ALTER TABLE `building_licensed_app_functions` ENABLE KEYS */;
  533. UNLOCK TABLES;
  534.  
  535. --
  536. -- Table structure for table `building_licensed_apps`
  537. --
  538.  
  539. DROP TABLE IF EXISTS `building_licensed_apps`;
  540. /*!40101 SET @saved_cs_client = @@character_set_client */;
  541. /*!40101 SET character_set_client = utf8 */;
  542. CREATE TABLE `building_licensed_apps` (
  543. `id` int(11) NOT NULL AUTO_INCREMENT,
  544. `building_id` int(11) DEFAULT NULL,
  545. `licensed_app_id` int(11) DEFAULT NULL,
  546. PRIMARY KEY (`id`),
  547. KEY `fk_building_licensed_apps_1_idx` (`building_id`),
  548. KEY `fk_building_licensed_apps_2_idx` (`licensed_app_id`),
  549. CONSTRAINT `fk_building_licensed_apps_1` FOREIGN KEY (`building_id`) REFERENCES `buildings` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  550. CONSTRAINT `fk_building_licensed_apps_2` FOREIGN KEY (`licensed_app_id`) REFERENCES `licensed_apps` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  551. ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
  552. /*!40101 SET character_set_client = @saved_cs_client */;
  553.  
  554. --
  555. -- Dumping data for table `building_licensed_apps`
  556. --
  557.  
  558. LOCK TABLES `building_licensed_apps` WRITE;
  559. /*!40000 ALTER TABLE `building_licensed_apps` DISABLE KEYS */;
  560. INSERT INTO `building_licensed_apps` VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4),(5,1,5),(6,1,6),(7,1,7),(8,1,8),(9,1,9),(10,1,10),(11,1,11),(12,1,13),(13,1,14),(14,1,15),(15,1,16),(16,2,1),(17,2,2),(18,2,3);
  561. /*!40000 ALTER TABLE `building_licensed_apps` ENABLE KEYS */;
  562. UNLOCK TABLES;
  563.  
  564. --
  565. -- Table structure for table `buildings`
  566. --
  567.  
  568. DROP TABLE IF EXISTS `buildings`;
  569. /*!40101 SET @saved_cs_client = @@character_set_client */;
  570. /*!40101 SET character_set_client = utf8 */;
  571. CREATE TABLE `buildings` (
  572. `id` int(11) NOT NULL AUTO_INCREMENT,
  573. `name` varchar(45) DEFAULT NULL,
  574. `site_code` varchar(45) DEFAULT NULL,
  575. `address` varchar(245) DEFAULT NULL,
  576. `managing_company_id` int(11) DEFAULT NULL,
  577. `description` text,
  578. `phone_number` varchar(45) DEFAULT NULL,
  579. PRIMARY KEY (`id`),
  580. KEY `fk_buildings_1_idx` (`managing_company_id`),
  581. CONSTRAINT `fk_buildings_1` FOREIGN KEY (`managing_company_id`) REFERENCES `managing_companies` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  582. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  583. /*!40101 SET character_set_client = @saved_cs_client */;
  584.  
  585. --
  586. -- Dumping data for table `buildings`
  587. --
  588.  
  589. LOCK TABLES `buildings` WRITE;
  590. /*!40000 ALTER TABLE `buildings` DISABLE KEYS */;
  591. INSERT INTO `buildings` VALUES (1,'Building 1','Building 1 Site Code','1732 Woodward Ct',1,'Paramount Properties. All Rights Reserved.','613-524-8875'),(2,'Building 2','Building 2 Site Code','200 Bank Street',2,'Capital Concierge','613-567-9089');
  592. /*!40000 ALTER TABLE `buildings` ENABLE KEYS */;
  593. UNLOCK TABLES;
  594.  
  595. --
  596. -- Table structure for table `classified_ad_category`
  597. --
  598.  
  599. DROP TABLE IF EXISTS `classified_ad_category`;
  600. /*!40101 SET @saved_cs_client = @@character_set_client */;
  601. /*!40101 SET character_set_client = utf8 */;
  602. CREATE TABLE `classified_ad_category` (
  603. `id` int(11) NOT NULL,
  604. `parent_category_id` int(11) DEFAULT '0',
  605. `category_name` varchar(45) DEFAULT NULL,
  606. PRIMARY KEY (`id`),
  607. KEY `fk_classified_ad_category_1_idx` (`parent_category_id`),
  608. CONSTRAINT `fk_classified_ad_category_1` FOREIGN KEY (`parent_category_id`) REFERENCES `classified_ad_category` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  609. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  610. /*!40101 SET character_set_client = @saved_cs_client */;
  611.  
  612. --
  613. -- Dumping data for table `classified_ad_category`
  614. --
  615.  
  616. LOCK TABLES `classified_ad_category` WRITE;
  617. /*!40000 ALTER TABLE `classified_ad_category` DISABLE KEYS */;
  618. /*!40000 ALTER TABLE `classified_ad_category` ENABLE KEYS */;
  619. UNLOCK TABLES;
  620.  
  621. --
  622. -- Table structure for table `classified_ad_item`
  623. --
  624.  
  625. DROP TABLE IF EXISTS `classified_ad_item`;
  626. /*!40101 SET @saved_cs_client = @@character_set_client */;
  627. /*!40101 SET character_set_client = utf8 */;
  628. CREATE TABLE `classified_ad_item` (
  629. `id` int(11) NOT NULL,
  630. `title` varchar(45) DEFAULT NULL,
  631. `description` text,
  632. `price` double DEFAULT NULL,
  633. `classified_ad_category_id` int(11) DEFAULT NULL,
  634. `user_id` int(11) DEFAULT NULL,
  635. `approved_status` tinyint(1) DEFAULT NULL,
  636. PRIMARY KEY (`id`),
  637. KEY `fk_classified_ad_item_1_idx` (`classified_ad_category_id`),
  638. KEY `fk_classified_ad_item_2_idx` (`user_id`),
  639. CONSTRAINT `fk_classified_ad_item_1` FOREIGN KEY (`classified_ad_category_id`) REFERENCES `classified_ad_category` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  640. CONSTRAINT `fk_classified_ad_item_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  641. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  642. /*!40101 SET character_set_client = @saved_cs_client */;
  643.  
  644. --
  645. -- Dumping data for table `classified_ad_item`
  646. --
  647.  
  648. LOCK TABLES `classified_ad_item` WRITE;
  649. /*!40000 ALTER TABLE `classified_ad_item` DISABLE KEYS */;
  650. /*!40000 ALTER TABLE `classified_ad_item` ENABLE KEYS */;
  651. UNLOCK TABLES;
  652.  
  653. --
  654. -- Table structure for table `classified_ad_item_images`
  655. --
  656.  
  657. DROP TABLE IF EXISTS `classified_ad_item_images`;
  658. /*!40101 SET @saved_cs_client = @@character_set_client */;
  659. /*!40101 SET character_set_client = utf8 */;
  660. CREATE TABLE `classified_ad_item_images` (
  661. `id` int(11) NOT NULL,
  662. `classified_ad_item_id` int(11) DEFAULT NULL,
  663. `img_path` varchar(145) DEFAULT NULL,
  664. PRIMARY KEY (`id`),
  665. KEY `fk_classified_ad_item_images_1_idx` (`classified_ad_item_id`),
  666. CONSTRAINT `fk_classified_ad_item_images_1` FOREIGN KEY (`classified_ad_item_id`) REFERENCES `classified_ad_item` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  667. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  668. /*!40101 SET character_set_client = @saved_cs_client */;
  669.  
  670. --
  671. -- Dumping data for table `classified_ad_item_images`
  672. --
  673.  
  674. LOCK TABLES `classified_ad_item_images` WRITE;
  675. /*!40000 ALTER TABLE `classified_ad_item_images` DISABLE KEYS */;
  676. /*!40000 ALTER TABLE `classified_ad_item_images` ENABLE KEYS */;
  677. UNLOCK TABLES;
  678.  
  679. --
  680. -- Table structure for table `community_events`
  681. --
  682.  
  683. DROP TABLE IF EXISTS `community_events`;
  684. /*!40101 SET @saved_cs_client = @@character_set_client */;
  685. /*!40101 SET character_set_client = utf8 */;
  686. CREATE TABLE `community_events` (
  687. `id` int(11) NOT NULL,
  688. `title` varchar(45) DEFAULT NULL,
  689. `description` longtext,
  690. `location` varchar(45) DEFAULT NULL,
  691. `start_datetime` datetime DEFAULT NULL,
  692. `end_datetime` datetime DEFAULT NULL,
  693. `user_id` int(11) DEFAULT NULL,
  694. PRIMARY KEY (`id`),
  695. KEY `fk_community_events_1_idx` (`user_id`),
  696. CONSTRAINT `fk_community_events_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  697. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  698. /*!40101 SET character_set_client = @saved_cs_client */;
  699.  
  700. --
  701. -- Dumping data for table `community_events`
  702. --
  703.  
  704. LOCK TABLES `community_events` WRITE;
  705. /*!40000 ALTER TABLE `community_events` DISABLE KEYS */;
  706. /*!40000 ALTER TABLE `community_events` ENABLE KEYS */;
  707. UNLOCK TABLES;
  708.  
  709. --
  710. -- Table structure for table `community_events_rsvps`
  711. --
  712.  
  713. DROP TABLE IF EXISTS `community_events_rsvps`;
  714. /*!40101 SET @saved_cs_client = @@character_set_client */;
  715. /*!40101 SET character_set_client = utf8 */;
  716. CREATE TABLE `community_events_rsvps` (
  717. `id` int(11) NOT NULL,
  718. `community_event_id` int(11) DEFAULT NULL,
  719. `user_id` int(11) DEFAULT NULL,
  720. PRIMARY KEY (`id`),
  721. KEY `fk_community_events_rsvps_1_idx` (`community_event_id`),
  722. KEY `fk_community_events_rsvps_2_idx` (`user_id`),
  723. CONSTRAINT `fk_community_events_rsvps_1` FOREIGN KEY (`community_event_id`) REFERENCES `community_events` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  724. CONSTRAINT `fk_community_events_rsvps_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  725. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  726. /*!40101 SET character_set_client = @saved_cs_client */;
  727.  
  728. --
  729. -- Dumping data for table `community_events_rsvps`
  730. --
  731.  
  732. LOCK TABLES `community_events_rsvps` WRITE;
  733. /*!40000 ALTER TABLE `community_events_rsvps` DISABLE KEYS */;
  734. /*!40000 ALTER TABLE `community_events_rsvps` ENABLE KEYS */;
  735. UNLOCK TABLES;
  736.  
  737. --
  738. -- Table structure for table `documents`
  739. --
  740.  
  741. DROP TABLE IF EXISTS `documents`;
  742. /*!40101 SET @saved_cs_client = @@character_set_client */;
  743. /*!40101 SET character_set_client = utf8 */;
  744. CREATE TABLE `documents` (
  745. `id` int(11) NOT NULL,
  746. `name` varchar(45) DEFAULT NULL,
  747. `description` text,
  748. `document_path` varchar(145) DEFAULT NULL,
  749. `accessible_to_residents` tinyint(1) DEFAULT NULL,
  750. `user_id` int(11) DEFAULT NULL,
  751. PRIMARY KEY (`id`),
  752. KEY `fk_documents_1_idx` (`user_id`),
  753. CONSTRAINT `fk_documents_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  754. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  755. /*!40101 SET character_set_client = @saved_cs_client */;
  756.  
  757. --
  758. -- Dumping data for table `documents`
  759. --
  760.  
  761. LOCK TABLES `documents` WRITE;
  762. /*!40000 ALTER TABLE `documents` DISABLE KEYS */;
  763. /*!40000 ALTER TABLE `documents` ENABLE KEYS */;
  764. UNLOCK TABLES;
  765.  
  766. --
  767. -- Table structure for table `entry_instructions`
  768. --
  769.  
  770. DROP TABLE IF EXISTS `entry_instructions`;
  771. /*!40101 SET @saved_cs_client = @@character_set_client */;
  772. /*!40101 SET character_set_client = utf8 */;
  773. CREATE TABLE `entry_instructions` (
  774. `id` int(11) NOT NULL,
  775. `visitor_first_name` varchar(45) DEFAULT NULL,
  776. `visitor_last_name` varchar(45) DEFAULT NULL,
  777. `needs_parking` tinyint(1) DEFAULT NULL,
  778. PRIMARY KEY (`id`)
  779. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  780. /*!40101 SET character_set_client = @saved_cs_client */;
  781.  
  782. --
  783. -- Dumping data for table `entry_instructions`
  784. --
  785.  
  786. LOCK TABLES `entry_instructions` WRITE;
  787. /*!40000 ALTER TABLE `entry_instructions` DISABLE KEYS */;
  788. /*!40000 ALTER TABLE `entry_instructions` ENABLE KEYS */;
  789. UNLOCK TABLES;
  790.  
  791. --
  792. -- Table structure for table `entry_instructions_vehicles`
  793. --
  794.  
  795. DROP TABLE IF EXISTS `entry_instructions_vehicles`;
  796. /*!40101 SET @saved_cs_client = @@character_set_client */;
  797. /*!40101 SET character_set_client = utf8 */;
  798. CREATE TABLE `entry_instructions_vehicles` (
  799. `id` int(11) NOT NULL,
  800. `entry_instruction_id` int(11) DEFAULT NULL,
  801. `vehicle_id` int(11) DEFAULT NULL,
  802. PRIMARY KEY (`id`),
  803. KEY `fk_entry_instructions_vehicles_1_idx` (`entry_instruction_id`),
  804. KEY `fk_entry_instructions_vehicles_2_idx` (`vehicle_id`),
  805. CONSTRAINT `fk_entry_instructions_vehicles_1` FOREIGN KEY (`entry_instruction_id`) REFERENCES `entry_instructions` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  806. CONSTRAINT `fk_entry_instructions_vehicles_2` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  807. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  808. /*!40101 SET character_set_client = @saved_cs_client */;
  809.  
  810. --
  811. -- Dumping data for table `entry_instructions_vehicles`
  812. --
  813.  
  814. LOCK TABLES `entry_instructions_vehicles` WRITE;
  815. /*!40000 ALTER TABLE `entry_instructions_vehicles` DISABLE KEYS */;
  816. /*!40000 ALTER TABLE `entry_instructions_vehicles` ENABLE KEYS */;
  817. UNLOCK TABLES;
  818.  
  819. --
  820. -- Table structure for table `guest_suite_bookings`
  821. --
  822.  
  823. DROP TABLE IF EXISTS `guest_suite_bookings`;
  824. /*!40101 SET @saved_cs_client = @@character_set_client */;
  825. /*!40101 SET character_set_client = utf8 */;
  826. CREATE TABLE `guest_suite_bookings` (
  827. `id` int(11) NOT NULL,
  828. `visitor_first_name` varchar(45) DEFAULT NULL,
  829. `visitor_last_name` varchar(45) DEFAULT NULL,
  830. `needs_parking` tinyint(1) DEFAULT NULL,
  831. `check_in_date` date DEFAULT NULL,
  832. `check_out_date` date DEFAULT NULL,
  833. `actual_check_in_date_time` datetime DEFAULT NULL,
  834. `actual_check_out_date_time` datetime DEFAULT NULL,
  835. `booked_by` int(11) DEFAULT NULL,
  836. `guest_suite_id` int(11) DEFAULT NULL,
  837. PRIMARY KEY (`id`),
  838. KEY `fk_guest_suite_bookings_1_idx` (`booked_by`),
  839. KEY `fk_guest_suite_bookings_2_idx` (`guest_suite_id`),
  840. CONSTRAINT `fk_guest_suite_bookings_1` FOREIGN KEY (`booked_by`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  841. CONSTRAINT `fk_guest_suite_bookings_2` FOREIGN KEY (`guest_suite_id`) REFERENCES `guest_suites` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  842. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  843. /*!40101 SET character_set_client = @saved_cs_client */;
  844.  
  845. --
  846. -- Dumping data for table `guest_suite_bookings`
  847. --
  848.  
  849. LOCK TABLES `guest_suite_bookings` WRITE;
  850. /*!40000 ALTER TABLE `guest_suite_bookings` DISABLE KEYS */;
  851. /*!40000 ALTER TABLE `guest_suite_bookings` ENABLE KEYS */;
  852. UNLOCK TABLES;
  853.  
  854. --
  855. -- Table structure for table `guest_suite_vehicle_bookings`
  856. --
  857.  
  858. DROP TABLE IF EXISTS `guest_suite_vehicle_bookings`;
  859. /*!40101 SET @saved_cs_client = @@character_set_client */;
  860. /*!40101 SET character_set_client = utf8 */;
  861. CREATE TABLE `guest_suite_vehicle_bookings` (
  862. `id` int(11) NOT NULL,
  863. `vehicle_id` int(11) DEFAULT NULL,
  864. `guest_suite_booking_id` int(11) DEFAULT NULL,
  865. PRIMARY KEY (`id`),
  866. KEY `fk_guest_suite_vehicle_bookings_1_idx` (`vehicle_id`),
  867. KEY `fk_guest_suite_vehicle_bookings_2_idx` (`guest_suite_booking_id`),
  868. CONSTRAINT `fk_guest_suite_vehicle_bookings_1` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  869. CONSTRAINT `fk_guest_suite_vehicle_bookings_2` FOREIGN KEY (`guest_suite_booking_id`) REFERENCES `guest_suite_bookings` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  870. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  871. /*!40101 SET character_set_client = @saved_cs_client */;
  872.  
  873. --
  874. -- Dumping data for table `guest_suite_vehicle_bookings`
  875. --
  876.  
  877. LOCK TABLES `guest_suite_vehicle_bookings` WRITE;
  878. /*!40000 ALTER TABLE `guest_suite_vehicle_bookings` DISABLE KEYS */;
  879. /*!40000 ALTER TABLE `guest_suite_vehicle_bookings` ENABLE KEYS */;
  880. UNLOCK TABLES;
  881.  
  882. --
  883. -- Table structure for table `guest_suites`
  884. --
  885.  
  886. DROP TABLE IF EXISTS `guest_suites`;
  887. /*!40101 SET @saved_cs_client = @@character_set_client */;
  888. /*!40101 SET character_set_client = utf8 */;
  889. CREATE TABLE `guest_suites` (
  890. `id` int(11) NOT NULL,
  891. `suite_number` varchar(45) DEFAULT NULL,
  892. PRIMARY KEY (`id`)
  893. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  894. /*!40101 SET character_set_client = @saved_cs_client */;
  895.  
  896. --
  897. -- Dumping data for table `guest_suites`
  898. --
  899.  
  900. LOCK TABLES `guest_suites` WRITE;
  901. /*!40000 ALTER TABLE `guest_suites` DISABLE KEYS */;
  902. /*!40000 ALTER TABLE `guest_suites` ENABLE KEYS */;
  903. UNLOCK TABLES;
  904.  
  905. --
  906. -- Table structure for table `incident_report_witnesses`
  907. --
  908.  
  909. DROP TABLE IF EXISTS `incident_report_witnesses`;
  910. /*!40101 SET @saved_cs_client = @@character_set_client */;
  911. /*!40101 SET character_set_client = utf8 */;
  912. CREATE TABLE `incident_report_witnesses` (
  913. `id` int(11) NOT NULL,
  914. `incident_report_id` int(11) DEFAULT NULL,
  915. `witness_name` varchar(145) DEFAULT NULL,
  916. `witness_address` longtext,
  917. `witness_phone_number` varchar(45) DEFAULT NULL,
  918. `witness_email` varchar(45) DEFAULT NULL,
  919. `witness_date_of_birth` varchar(45) DEFAULT NULL,
  920. `witness_statement` longtext,
  921. PRIMARY KEY (`id`),
  922. KEY `fk_incident_report_witnesses_1_idx` (`incident_report_id`),
  923. CONSTRAINT `fk_incident_report_witnesses_1` FOREIGN KEY (`incident_report_id`) REFERENCES `incident_reports` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  924. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  925. /*!40101 SET character_set_client = @saved_cs_client */;
  926.  
  927. --
  928. -- Dumping data for table `incident_report_witnesses`
  929. --
  930.  
  931. LOCK TABLES `incident_report_witnesses` WRITE;
  932. /*!40000 ALTER TABLE `incident_report_witnesses` DISABLE KEYS */;
  933. /*!40000 ALTER TABLE `incident_report_witnesses` ENABLE KEYS */;
  934. UNLOCK TABLES;
  935.  
  936. --
  937. -- Table structure for table `incident_reports`
  938. --
  939.  
  940. DROP TABLE IF EXISTS `incident_reports`;
  941. /*!40101 SET @saved_cs_client = @@character_set_client */;
  942. /*!40101 SET character_set_client = utf8 */;
  943. CREATE TABLE `incident_reports` (
  944. `id` int(11) NOT NULL,
  945. `title` varchar(45) DEFAULT NULL,
  946. `description` longtext,
  947. `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  948. `user_id` int(11) DEFAULT NULL,
  949. `reported_to_police` tinyint(1) DEFAULT NULL,
  950. `police_station_name` varchar(145) DEFAULT NULL,
  951. `police_station_address` longtext,
  952. `police_officer_name` varchar(145) DEFAULT NULL,
  953. `police_officer_number` varchar(45) DEFAULT NULL,
  954. PRIMARY KEY (`id`)
  955. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  956. /*!40101 SET character_set_client = @saved_cs_client */;
  957.  
  958. --
  959. -- Dumping data for table `incident_reports`
  960. --
  961.  
  962. LOCK TABLES `incident_reports` WRITE;
  963. /*!40000 ALTER TABLE `incident_reports` DISABLE KEYS */;
  964. /*!40000 ALTER TABLE `incident_reports` ENABLE KEYS */;
  965. UNLOCK TABLES;
  966.  
  967. --
  968. -- Table structure for table `licensed_app_functions`
  969. --
  970.  
  971. DROP TABLE IF EXISTS `licensed_app_functions`;
  972. /*!40101 SET @saved_cs_client = @@character_set_client */;
  973. /*!40101 SET character_set_client = utf8 */;
  974. CREATE TABLE `licensed_app_functions` (
  975. `id` int(11) NOT NULL AUTO_INCREMENT,
  976. `licensed_app_id` int(11) DEFAULT NULL,
  977. `function_name` varchar(45) DEFAULT NULL,
  978. PRIMARY KEY (`id`),
  979. KEY `fk_licensed_app_functions_1_idx` (`licensed_app_id`),
  980. CONSTRAINT `fk_licensed_app_functions_1` FOREIGN KEY (`licensed_app_id`) REFERENCES `licensed_apps` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  981. ) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8;
  982. /*!40101 SET character_set_client = @saved_cs_client */;
  983.  
  984. --
  985. -- Dumping data for table `licensed_app_functions`
  986. --
  987.  
  988. LOCK TABLES `licensed_app_functions` WRITE;
  989. /*!40000 ALTER TABLE `licensed_app_functions` DISABLE KEYS */;
  990. INSERT INTO `licensed_app_functions` VALUES (1,1,'Create'),(2,1,'View'),(3,1,'Edit'),(4,1,'Delete'),(5,2,'Create'),(6,2,'View'),(7,2,'Edit'),(8,2,'Delete'),(9,3,'Create'),(10,3,'View'),(11,3,'Edit'),(12,3,'Delete'),(13,4,'Create'),(14,4,'View'),(15,4,'Edit'),(16,4,'Delete'),(17,5,'Create'),(18,5,'View'),(19,5,'Edit'),(20,5,'Delete'),(21,5,'Manage Approvals'),(22,6,'Create'),(23,6,'View'),(24,6,'Edit'),(25,6,'Delete'),(26,7,'Create'),(27,7,'View'),(28,7,'Edit'),(29,7,'Delete'),(30,8,'Create'),(31,8,'View'),(32,8,'Edit'),(33,8,'Delete'),(34,8,'Notify'),(35,9,'Create'),(36,9,'View'),(37,9,'Edit'),(38,9,'Delete'),(39,9,'Manage Approvals'),(40,10,'Create'),(41,10,'View'),(42,10,'Edit'),(43,10,'Delete'),(44,10,'Manage Approvals'),(45,11,'Create'),(46,11,'View'),(47,11,'Edit'),(48,11,'Delete'),(49,11,'Manage Approvals'),(50,13,'Create'),(51,13,'View'),(52,13,'Edit'),(53,13,'Delete'),(54,14,'Create'),(55,14,'View'),(56,14,'Edit'),(57,14,'Delete'),(58,15,'Create'),(59,15,'View'),(60,15,'Edit'),(61,15,'Delete'),(62,16,'Create'),(63,16,'View'),(64,16,'Edit'),(65,16,'Delete');
  991. /*!40000 ALTER TABLE `licensed_app_functions` ENABLE KEYS */;
  992. UNLOCK TABLES;
  993.  
  994. --
  995. -- Table structure for table `licensed_apps`
  996. --
  997.  
  998. DROP TABLE IF EXISTS `licensed_apps`;
  999. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1000. /*!40101 SET character_set_client = utf8 */;
  1001. CREATE TABLE `licensed_apps` (
  1002. `id` int(11) NOT NULL AUTO_INCREMENT,
  1003. `app_name` varchar(45) DEFAULT NULL,
  1004. PRIMARY KEY (`id`)
  1005. ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
  1006. /*!40101 SET character_set_client = @saved_cs_client */;
  1007.  
  1008. --
  1009. -- Dumping data for table `licensed_apps`
  1010. --
  1011.  
  1012. LOCK TABLES `licensed_apps` WRITE;
  1013. /*!40000 ALTER TABLE `licensed_apps` DISABLE KEYS */;
  1014. INSERT INTO `licensed_apps` VALUES (1,'Amenities'),(2,'Guest Suite'),(3,'Maintenance Requests'),(4,'Documents'),(5,'Classified Ads'),(6,'Announcements'),(7,'Entry Instructions'),(8,'Parcel Delivery'),(9,'Community Calendar'),(10,'Lockers'),(11,'Bike Storage'),(12,'Parking'),(13,'Incident Reporting'),(14,'Financial Reports'),(15,'Work Orders'),(16,'Users');
  1015. /*!40000 ALTER TABLE `licensed_apps` ENABLE KEYS */;
  1016. UNLOCK TABLES;
  1017.  
  1018. --
  1019. -- Table structure for table `locker_assignment_statuses`
  1020. --
  1021.  
  1022. DROP TABLE IF EXISTS `locker_assignment_statuses`;
  1023. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1024. /*!40101 SET character_set_client = utf8 */;
  1025. CREATE TABLE `locker_assignment_statuses` (
  1026. `id` int(11) NOT NULL,
  1027. `status_name` varchar(45) DEFAULT NULL,
  1028. PRIMARY KEY (`id`)
  1029. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1030. /*!40101 SET character_set_client = @saved_cs_client */;
  1031.  
  1032. --
  1033. -- Dumping data for table `locker_assignment_statuses`
  1034. --
  1035.  
  1036. LOCK TABLES `locker_assignment_statuses` WRITE;
  1037. /*!40000 ALTER TABLE `locker_assignment_statuses` DISABLE KEYS */;
  1038. /*!40000 ALTER TABLE `locker_assignment_statuses` ENABLE KEYS */;
  1039. UNLOCK TABLES;
  1040.  
  1041. --
  1042. -- Table structure for table `locker_assignments`
  1043. --
  1044.  
  1045. DROP TABLE IF EXISTS `locker_assignments`;
  1046. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1047. /*!40101 SET character_set_client = utf8 */;
  1048. CREATE TABLE `locker_assignments` (
  1049. `id` int(11) NOT NULL,
  1050. `locker_id` int(11) DEFAULT NULL,
  1051. `user_id` int(11) DEFAULT NULL,
  1052. `lock_type` int(11) DEFAULT NULL,
  1053. `lock_combination_number` varchar(145) DEFAULT NULL,
  1054. `assignment_status_id` int(11) DEFAULT NULL,
  1055. PRIMARY KEY (`id`),
  1056. KEY `fk_locker_assignments_1_idx` (`locker_id`),
  1057. KEY `fk_locker_assignments_2_idx` (`user_id`),
  1058. KEY `fk_locker_assignments_3_idx` (`assignment_status_id`),
  1059. CONSTRAINT `fk_locker_assignments_1` FOREIGN KEY (`locker_id`) REFERENCES `lockers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  1060. CONSTRAINT `fk_locker_assignments_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  1061. CONSTRAINT `fk_locker_assignments_3` FOREIGN KEY (`assignment_status_id`) REFERENCES `locker_assignment_statuses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1062. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1063. /*!40101 SET character_set_client = @saved_cs_client */;
  1064.  
  1065. --
  1066. -- Dumping data for table `locker_assignments`
  1067. --
  1068.  
  1069. LOCK TABLES `locker_assignments` WRITE;
  1070. /*!40000 ALTER TABLE `locker_assignments` DISABLE KEYS */;
  1071. /*!40000 ALTER TABLE `locker_assignments` ENABLE KEYS */;
  1072. UNLOCK TABLES;
  1073.  
  1074. --
  1075. -- Table structure for table `locker_locations`
  1076. --
  1077.  
  1078. DROP TABLE IF EXISTS `locker_locations`;
  1079. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1080. /*!40101 SET character_set_client = utf8 */;
  1081. CREATE TABLE `locker_locations` (
  1082. `id` int(11) NOT NULL,
  1083. `location_name` varchar(45) DEFAULT NULL,
  1084. PRIMARY KEY (`id`)
  1085. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1086. /*!40101 SET character_set_client = @saved_cs_client */;
  1087.  
  1088. --
  1089. -- Dumping data for table `locker_locations`
  1090. --
  1091.  
  1092. LOCK TABLES `locker_locations` WRITE;
  1093. /*!40000 ALTER TABLE `locker_locations` DISABLE KEYS */;
  1094. /*!40000 ALTER TABLE `locker_locations` ENABLE KEYS */;
  1095. UNLOCK TABLES;
  1096.  
  1097. --
  1098. -- Table structure for table `lockers`
  1099. --
  1100.  
  1101. DROP TABLE IF EXISTS `lockers`;
  1102. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1103. /*!40101 SET character_set_client = utf8 */;
  1104. CREATE TABLE `lockers` (
  1105. `id` int(11) NOT NULL,
  1106. `locker_location_id` int(11) DEFAULT NULL,
  1107. `legal_description` varchar(45) DEFAULT NULL,
  1108. `locker_number` varchar(45) DEFAULT NULL,
  1109. PRIMARY KEY (`id`),
  1110. KEY `fk_lockers_1_idx` (`locker_location_id`),
  1111. CONSTRAINT `fk_lockers_1` FOREIGN KEY (`locker_location_id`) REFERENCES `locker_locations` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1112. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1113. /*!40101 SET character_set_client = @saved_cs_client */;
  1114.  
  1115. --
  1116. -- Dumping data for table `lockers`
  1117. --
  1118.  
  1119. LOCK TABLES `lockers` WRITE;
  1120. /*!40000 ALTER TABLE `lockers` DISABLE KEYS */;
  1121. /*!40000 ALTER TABLE `lockers` ENABLE KEYS */;
  1122. UNLOCK TABLES;
  1123.  
  1124. --
  1125. -- Table structure for table `maintenance_request_statuses`
  1126. --
  1127.  
  1128. DROP TABLE IF EXISTS `maintenance_request_statuses`;
  1129. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1130. /*!40101 SET character_set_client = utf8 */;
  1131. CREATE TABLE `maintenance_request_statuses` (
  1132. `id` int(11) NOT NULL AUTO_INCREMENT,
  1133. `status_name` varchar(45) DEFAULT NULL,
  1134. PRIMARY KEY (`id`)
  1135. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  1136. /*!40101 SET character_set_client = @saved_cs_client */;
  1137.  
  1138. --
  1139. -- Dumping data for table `maintenance_request_statuses`
  1140. --
  1141.  
  1142. LOCK TABLES `maintenance_request_statuses` WRITE;
  1143. /*!40000 ALTER TABLE `maintenance_request_statuses` DISABLE KEYS */;
  1144. INSERT INTO `maintenance_request_statuses` VALUES (1,'Pending'),(2,'Completed'),(3,'Declined');
  1145. /*!40000 ALTER TABLE `maintenance_request_statuses` ENABLE KEYS */;
  1146. UNLOCK TABLES;
  1147.  
  1148. --
  1149. -- Table structure for table `maintenance_request_urgencies`
  1150. --
  1151.  
  1152. DROP TABLE IF EXISTS `maintenance_request_urgencies`;
  1153. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1154. /*!40101 SET character_set_client = utf8 */;
  1155. CREATE TABLE `maintenance_request_urgencies` (
  1156. `id` int(11) NOT NULL AUTO_INCREMENT,
  1157. `urgency_name` varchar(45) DEFAULT NULL,
  1158. PRIMARY KEY (`id`)
  1159. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  1160. /*!40101 SET character_set_client = @saved_cs_client */;
  1161.  
  1162. --
  1163. -- Dumping data for table `maintenance_request_urgencies`
  1164. --
  1165.  
  1166. LOCK TABLES `maintenance_request_urgencies` WRITE;
  1167. /*!40000 ALTER TABLE `maintenance_request_urgencies` DISABLE KEYS */;
  1168. INSERT INTO `maintenance_request_urgencies` VALUES (1,'High'),(2,'Medium'),(3,'Low');
  1169. /*!40000 ALTER TABLE `maintenance_request_urgencies` ENABLE KEYS */;
  1170. UNLOCK TABLES;
  1171.  
  1172. --
  1173. -- Table structure for table `maintenance_requests`
  1174. --
  1175.  
  1176. DROP TABLE IF EXISTS `maintenance_requests`;
  1177. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1178. /*!40101 SET character_set_client = utf8 */;
  1179. CREATE TABLE `maintenance_requests` (
  1180. `id` int(11) NOT NULL AUTO_INCREMENT,
  1181. `user_id` int(11) DEFAULT NULL,
  1182. `maintenance_request_status_id` int(11) DEFAULT NULL,
  1183. `title` varchar(255) DEFAULT NULL,
  1184. `description` longtext,
  1185. `maintenance_request_urgency_id` int(11) DEFAULT NULL,
  1186. `request_date` datetime DEFAULT NULL,
  1187. `consent_access` tinyint(1) DEFAULT NULL,
  1188. `completed_date` datetime DEFAULT NULL,
  1189. PRIMARY KEY (`id`),
  1190. KEY `fk_maintenance_requests_1_idx` (`user_id`),
  1191. KEY `fk_maintenance_requests_2_idx` (`maintenance_request_status_id`),
  1192. KEY `fk_maintenance_requests_3_idx` (`maintenance_request_urgency_id`),
  1193. CONSTRAINT `fk_maintenance_requests_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  1194. CONSTRAINT `fk_maintenance_requests_2` FOREIGN KEY (`maintenance_request_status_id`) REFERENCES `maintenance_request_statuses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  1195. CONSTRAINT `fk_maintenance_requests_3` FOREIGN KEY (`maintenance_request_urgency_id`) REFERENCES `maintenance_request_urgencies` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1196. ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8;
  1197. /*!40101 SET character_set_client = @saved_cs_client */;
  1198.  
  1199. --
  1200. -- Dumping data for table `maintenance_requests`
  1201. --
  1202.  
  1203. LOCK TABLES `maintenance_requests` WRITE;
  1204. /*!40000 ALTER TABLE `maintenance_requests` DISABLE KEYS */;
  1205. INSERT INTO `maintenance_requests` VALUES (1,17,2,'Change Windows','I would like my windows changed ASAP',2,'2015-04-13 10:00:45',1,NULL),(2,17,1,'Fix Sink','My sink is clogged',1,'2015-04-13 11:00:45',1,NULL),(3,17,3,'Heater not working','The heater is not working in our apartment',1,'2015-04-13 12:00:45',1,NULL),(5,17,1,'Shiles maintenance request title','Shiles maintenance request description',1,'2015-04-14 12:00:45',1,NULL),(14,17,1,'gsdfsd','gsdfsf',1,'2015-03-04 00:00:00',1,NULL),(15,17,1,'Carlys maintenance request','maintenance request222222',2,'2015-08-04 00:00:00',1,NULL),(35,17,1,'bbbbb','bbbbbbbbbbb',1,'2015-10-04 00:00:00',1,NULL),(36,17,1,'cccccccc','ccccccccccccc',1,'2015-11-04 00:00:00',1,NULL),(37,17,1,'fffffffff','fffffffffff',3,'2015-07-04 00:00:00',0,NULL);
  1206. /*!40000 ALTER TABLE `maintenance_requests` ENABLE KEYS */;
  1207. UNLOCK TABLES;
  1208.  
  1209. --
  1210. -- Table structure for table `managing_companies`
  1211. --
  1212.  
  1213. DROP TABLE IF EXISTS `managing_companies`;
  1214. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1215. /*!40101 SET character_set_client = utf8 */;
  1216. CREATE TABLE `managing_companies` (
  1217. `id` int(11) NOT NULL,
  1218. `name` varchar(45) DEFAULT NULL,
  1219. PRIMARY KEY (`id`)
  1220. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1221. /*!40101 SET character_set_client = @saved_cs_client */;
  1222.  
  1223. --
  1224. -- Dumping data for table `managing_companies`
  1225. --
  1226.  
  1227. LOCK TABLES `managing_companies` WRITE;
  1228. /*!40000 ALTER TABLE `managing_companies` DISABLE KEYS */;
  1229. INSERT INTO `managing_companies` VALUES (1,'Company 1'),(2,'Company 2');
  1230. /*!40000 ALTER TABLE `managing_companies` ENABLE KEYS */;
  1231. UNLOCK TABLES;
  1232.  
  1233. --
  1234. -- Table structure for table `package_deliveries`
  1235. --
  1236.  
  1237. DROP TABLE IF EXISTS `package_deliveries`;
  1238. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1239. /*!40101 SET character_set_client = utf8 */;
  1240. CREATE TABLE `package_deliveries` (
  1241. `id` int(11) NOT NULL,
  1242. `name` varchar(45) DEFAULT NULL,
  1243. `delivery_date` date DEFAULT NULL,
  1244. `notes` longtext,
  1245. `user_id` int(11) DEFAULT NULL,
  1246. `package_delivery_status_id` int(11) DEFAULT NULL,
  1247. PRIMARY KEY (`id`),
  1248. KEY `fk_package_deliveries_1_idx` (`package_delivery_status_id`),
  1249. CONSTRAINT `fk_package_deliveries_1` FOREIGN KEY (`package_delivery_status_id`) REFERENCES `package_delivery_statuses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1250. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1251. /*!40101 SET character_set_client = @saved_cs_client */;
  1252.  
  1253. --
  1254. -- Dumping data for table `package_deliveries`
  1255. --
  1256.  
  1257. LOCK TABLES `package_deliveries` WRITE;
  1258. /*!40000 ALTER TABLE `package_deliveries` DISABLE KEYS */;
  1259. /*!40000 ALTER TABLE `package_deliveries` ENABLE KEYS */;
  1260. UNLOCK TABLES;
  1261.  
  1262. --
  1263. -- Table structure for table `package_delivery_statuses`
  1264. --
  1265.  
  1266. DROP TABLE IF EXISTS `package_delivery_statuses`;
  1267. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1268. /*!40101 SET character_set_client = utf8 */;
  1269. CREATE TABLE `package_delivery_statuses` (
  1270. `id` int(11) NOT NULL,
  1271. `status_name` varchar(45) DEFAULT NULL,
  1272. PRIMARY KEY (`id`)
  1273. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1274. /*!40101 SET character_set_client = @saved_cs_client */;
  1275.  
  1276. --
  1277. -- Dumping data for table `package_delivery_statuses`
  1278. --
  1279.  
  1280. LOCK TABLES `package_delivery_statuses` WRITE;
  1281. /*!40000 ALTER TABLE `package_delivery_statuses` DISABLE KEYS */;
  1282. /*!40000 ALTER TABLE `package_delivery_statuses` ENABLE KEYS */;
  1283. UNLOCK TABLES;
  1284.  
  1285. --
  1286. -- Table structure for table `role_permissions`
  1287. --
  1288.  
  1289. DROP TABLE IF EXISTS `role_permissions`;
  1290. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1291. /*!40101 SET character_set_client = utf8 */;
  1292. CREATE TABLE `role_permissions` (
  1293. `id` int(11) NOT NULL AUTO_INCREMENT,
  1294. `role_id` int(11) DEFAULT NULL,
  1295. `building_licensed_app_id` int(11) DEFAULT NULL,
  1296. `licensed_app_function_id` int(11) DEFAULT NULL,
  1297. PRIMARY KEY (`id`),
  1298. KEY `fk_role_permissions_1_idx` (`role_id`),
  1299. KEY `fk_role_permissions_2_idx` (`building_licensed_app_id`),
  1300. KEY `fk_role_permissions_3_idx` (`licensed_app_function_id`),
  1301. CONSTRAINT `fk_role_permissions_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  1302. CONSTRAINT `fk_role_permissions_2` FOREIGN KEY (`building_licensed_app_id`) REFERENCES `building_licensed_apps` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  1303. CONSTRAINT `fk_role_permissions_3` FOREIGN KEY (`licensed_app_function_id`) REFERENCES `licensed_app_functions` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1304. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1305. /*!40101 SET character_set_client = @saved_cs_client */;
  1306.  
  1307. --
  1308. -- Dumping data for table `role_permissions`
  1309. --
  1310.  
  1311. LOCK TABLES `role_permissions` WRITE;
  1312. /*!40000 ALTER TABLE `role_permissions` DISABLE KEYS */;
  1313. /*!40000 ALTER TABLE `role_permissions` ENABLE KEYS */;
  1314. UNLOCK TABLES;
  1315.  
  1316. --
  1317. -- Table structure for table `roles`
  1318. --
  1319.  
  1320. DROP TABLE IF EXISTS `roles`;
  1321. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1322. /*!40101 SET character_set_client = utf8 */;
  1323. CREATE TABLE `roles` (
  1324. `id` int(11) NOT NULL AUTO_INCREMENT,
  1325. `role_name` varchar(45) DEFAULT NULL,
  1326. `color_code` varchar(45) DEFAULT '#D8BF3E',
  1327. `can_manage_all_buildings` tinyint(1) DEFAULT NULL,
  1328. PRIMARY KEY (`id`)
  1329. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  1330. /*!40101 SET character_set_client = @saved_cs_client */;
  1331.  
  1332. --
  1333. -- Dumping data for table `roles`
  1334. --
  1335.  
  1336. LOCK TABLES `roles` WRITE;
  1337. /*!40000 ALTER TABLE `roles` DISABLE KEYS */;
  1338. INSERT INTO `roles` VALUES (1,'System Administrator','#D83E55',1),(2,'Superintendent','#D8BF3E',1);
  1339. /*!40000 ALTER TABLE `roles` ENABLE KEYS */;
  1340. UNLOCK TABLES;
  1341.  
  1342. --
  1343. -- Table structure for table `schema_migrations`
  1344. --
  1345.  
  1346. DROP TABLE IF EXISTS `schema_migrations`;
  1347. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1348. /*!40101 SET character_set_client = utf8 */;
  1349. CREATE TABLE `schema_migrations` (
  1350. `version` varchar(255) NOT NULL,
  1351. UNIQUE KEY `unique_schema_migrations` (`version`)
  1352. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1353. /*!40101 SET character_set_client = @saved_cs_client */;
  1354.  
  1355. --
  1356. -- Dumping data for table `schema_migrations`
  1357. --
  1358.  
  1359. LOCK TABLES `schema_migrations` WRITE;
  1360. /*!40000 ALTER TABLE `schema_migrations` DISABLE KEYS */;
  1361. /*!40000 ALTER TABLE `schema_migrations` ENABLE KEYS */;
  1362. UNLOCK TABLES;
  1363.  
  1364. --
  1365. -- Table structure for table `tokens`
  1366. --
  1367.  
  1368. DROP TABLE IF EXISTS `tokens`;
  1369. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1370. /*!40101 SET character_set_client = utf8 */;
  1371. CREATE TABLE `tokens` (
  1372. `id` int(11) NOT NULL,
  1373. `token` varchar(45) DEFAULT NULL,
  1374. `used` tinyint(1) DEFAULT '0',
  1375. `building_id` int(11) DEFAULT NULL,
  1376. PRIMARY KEY (`id`),
  1377. KEY `fk_tokens_1_idx` (`building_id`),
  1378. CONSTRAINT `fk_tokens_1` FOREIGN KEY (`building_id`) REFERENCES `buildings` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1379. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1380. /*!40101 SET character_set_client = @saved_cs_client */;
  1381.  
  1382. --
  1383. -- Dumping data for table `tokens`
  1384. --
  1385.  
  1386. LOCK TABLES `tokens` WRITE;
  1387. /*!40000 ALTER TABLE `tokens` DISABLE KEYS */;
  1388. INSERT INTO `tokens` VALUES (1,'D91FBFBB19',0,1),(2,'27CA9B87B4',0,1),(3,'2CAD68F9B3',0,1),(4,'484C8CDA5F',1,1),(5,'5D04DBB46A',0,1);
  1389. /*!40000 ALTER TABLE `tokens` ENABLE KEYS */;
  1390. UNLOCK TABLES;
  1391.  
  1392. --
  1393. -- Table structure for table `user_tokens`
  1394. --
  1395.  
  1396. DROP TABLE IF EXISTS `user_tokens`;
  1397. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1398. /*!40101 SET character_set_client = utf8 */;
  1399. CREATE TABLE `user_tokens` (
  1400. `id` int(11) NOT NULL,
  1401. `token_id` int(11) DEFAULT NULL,
  1402. `user_id` int(11) DEFAULT NULL,
  1403. `date_used` datetime DEFAULT NULL,
  1404. PRIMARY KEY (`id`),
  1405. KEY `fk_user_tokens_1_idx` (`user_id`),
  1406. KEY `fk_user_tokens_2_idx` (`token_id`),
  1407. CONSTRAINT `fk_user_tokens_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  1408. CONSTRAINT `fk_user_tokens_2` FOREIGN KEY (`token_id`) REFERENCES `tokens` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1409. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1410. /*!40101 SET character_set_client = @saved_cs_client */;
  1411.  
  1412. --
  1413. -- Dumping data for table `user_tokens`
  1414. --
  1415.  
  1416. LOCK TABLES `user_tokens` WRITE;
  1417. /*!40000 ALTER TABLE `user_tokens` DISABLE KEYS */;
  1418. /*!40000 ALTER TABLE `user_tokens` ENABLE KEYS */;
  1419. UNLOCK TABLES;
  1420.  
  1421. --
  1422. -- Table structure for table `users`
  1423. --
  1424.  
  1425. DROP TABLE IF EXISTS `users`;
  1426. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1427. /*!40101 SET character_set_client = utf8 */;
  1428. CREATE TABLE `users` (
  1429. `id` int(11) NOT NULL AUTO_INCREMENT,
  1430. `email` varchar(255) NOT NULL DEFAULT '',
  1431. `password_digest` text NOT NULL,
  1432. `password_reset_token` varchar(255) DEFAULT NULL,
  1433. `password_reset_sent_at` datetime DEFAULT NULL,
  1434. `created_at` datetime DEFAULT NULL,
  1435. `phone` varchar(45) DEFAULT NULL,
  1436. `building_id` int(11) DEFAULT NULL,
  1437. `role_id` int(11) DEFAULT NULL,
  1438. `first_name` varchar(255) DEFAULT NULL,
  1439. `last_name` varchar(255) DEFAULT NULL,
  1440. `email_confirmed` tinyint(4) DEFAULT NULL,
  1441. `remember_token` varchar(255) DEFAULT NULL,
  1442. `password_sent_at` varchar(255) DEFAULT NULL,
  1443. `unit` varchar(45) DEFAULT NULL,
  1444. PRIMARY KEY (`id`),
  1445. UNIQUE KEY `email_UNIQUE` (`email`),
  1446. KEY `fk_users_1_idx` (`building_id`),
  1447. KEY `fk_users_2_idx` (`role_id`),
  1448. CONSTRAINT `fk_users_1` FOREIGN KEY (`building_id`) REFERENCES `buildings` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  1449. CONSTRAINT `fk_users_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1450. ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
  1451. /*!40101 SET character_set_client = @saved_cs_client */;
  1452.  
  1453. --
  1454. -- Dumping data for table `users`
  1455. --
  1456.  
  1457. LOCK TABLES `users` WRITE;
  1458. /*!40000 ALTER TABLE `users` DISABLE KEYS */;
  1459. INSERT INTO `users` VALUES (2,'shilefasugba2@gmail.com','$2a$10$hdigALnpcBBNYi8dPH349.MB1rafzcj3eqr88ebIrUlxd9cDfnh6a','',NULL,'2015-04-07 16:00:54','6132055587',1,1,NULL,NULL,NULL,NULL,NULL,'1'),(4,'shile.smartbuildingapps@gmail.com','$2a$10$CoiPRYy3D26rrYpOuy7ElO2i0UU/H9OwKCiGwENMVS.ZKlmHNlfcq',NULL,NULL,'2015-04-08 14:55:17','6477028199',NULL,NULL,'Shile','Fasugba',NULL,NULL,NULL,'1'),(5,'shile2@gmail.com','$2a$10$uKIuC7Cglj4hpEttFUcaXe12BEAYVFkE8zHzUeG/ET1EflFBD3wgK',NULL,NULL,'2015-04-08 15:18:24','6477028199',NULL,NULL,'Shile','Fasugba',NULL,NULL,NULL,'1'),(6,'shile3@gmail.com','$2a$10$Hi69kCQ1O6CX7Xur7/KsnuzIEKhhbnSakqDIZ4qzpmZX1KhNIpJp.',NULL,NULL,'2015-04-09 19:22:18','6558888888',NULL,NULL,'Shile','Fasugba',NULL,NULL,NULL,'1'),(7,'sdfs@bdf.com','$2a$10$wu9LV3C7F0bI/XABhBMnE.4W9T52p1DhTsFaABKwyerVWyfHjqx0a',NULL,NULL,'2015-04-09 19:25:19','3423232333',1,NULL,'sdsd','sdfsl',NULL,NULL,NULL,'1'),(8,'asa@sds.com','$2a$10$Vg2ZMHszDMsWxqxWealDsum3UENTkP74mNIJJFZvZn36mkyoni42i',NULL,NULL,'2015-04-09 20:11:19','3423232333',NULL,NULL,'sdsd','sfsg',NULL,NULL,NULL,'1'),(9,'admin@mail.com','$2a$10$ggkcXw5NIGFXXOtfFIftz.bkL3AjV/jaEMI7XzccOhWj5e9rfZcAq',NULL,NULL,'2015-04-10 15:48:07','6558888888',1,NULL,'sdsd','sdfsl',NULL,NULL,NULL,'1'),(10,'admin22@mail.com','$2a$10$g.8e70zCEoQT3ylNJQB3F.POlrtN/k4f/Q7Yu0iVvdZ9s1mNgc9aO',NULL,NULL,'2015-04-10 16:21:51','3423232333',1,NULL,'sdsd','sdfsl',NULL,NULL,NULL,'1'),(17,'shilefasugba@gmail.com','$2a$10$o6b2tiNDGQZyBq4G/RCwGutn9Wdeh0i.VHujqQuPVWqM3OvGuGb6y',NULL,NULL,'2015-04-10 19:38:53','6477028199',1,1,'Shile','Fasugba',1,'Kx9ASd3P547TxTjS5YTeRQ','2015-04-10 19:38:53','12');
  1460. /*!40000 ALTER TABLE `users` ENABLE KEYS */;
  1461. UNLOCK TABLES;
  1462.  
  1463. --
  1464. -- Table structure for table `vehicles`
  1465. --
  1466.  
  1467. DROP TABLE IF EXISTS `vehicles`;
  1468. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1469. /*!40101 SET character_set_client = utf8 */;
  1470. CREATE TABLE `vehicles` (
  1471. `id` int(11) NOT NULL,
  1472. `name` varchar(45) DEFAULT NULL,
  1473. `license_plate` varchar(45) DEFAULT NULL,
  1474. `make` varchar(45) DEFAULT NULL,
  1475. `model` varchar(145) DEFAULT NULL,
  1476. `year` varchar(45) DEFAULT NULL,
  1477. PRIMARY KEY (`id`)
  1478. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Vehicle Prototype -> Parking Requirements might change this';
  1479. /*!40101 SET character_set_client = @saved_cs_client */;
  1480.  
  1481. --
  1482. -- Dumping data for table `vehicles`
  1483. --
  1484.  
  1485. LOCK TABLES `vehicles` WRITE;
  1486. /*!40000 ALTER TABLE `vehicles` DISABLE KEYS */;
  1487. /*!40000 ALTER TABLE `vehicles` ENABLE KEYS */;
  1488. UNLOCK TABLES;
  1489.  
  1490. --
  1491. -- Table structure for table `vendor_categories`
  1492. --
  1493.  
  1494. DROP TABLE IF EXISTS `vendor_categories`;
  1495. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1496. /*!40101 SET character_set_client = utf8 */;
  1497. CREATE TABLE `vendor_categories` (
  1498. `id` int(11) NOT NULL,
  1499. `category_name` varchar(45) DEFAULT NULL,
  1500. PRIMARY KEY (`id`)
  1501. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1502. /*!40101 SET character_set_client = @saved_cs_client */;
  1503.  
  1504. --
  1505. -- Dumping data for table `vendor_categories`
  1506. --
  1507.  
  1508. LOCK TABLES `vendor_categories` WRITE;
  1509. /*!40000 ALTER TABLE `vendor_categories` DISABLE KEYS */;
  1510. /*!40000 ALTER TABLE `vendor_categories` ENABLE KEYS */;
  1511. UNLOCK TABLES;
  1512.  
  1513. --
  1514. -- Table structure for table `vendors`
  1515. --
  1516.  
  1517. DROP TABLE IF EXISTS `vendors`;
  1518. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1519. /*!40101 SET character_set_client = utf8 */;
  1520. CREATE TABLE `vendors` (
  1521. `id` int(11) NOT NULL,
  1522. `name` varchar(45) DEFAULT NULL,
  1523. `building_id` int(11) DEFAULT NULL,
  1524. `vendor_category_id` int(11) DEFAULT NULL,
  1525. `img_path` varchar(145) DEFAULT NULL,
  1526. PRIMARY KEY (`id`),
  1527. KEY `fk_vendors_1_idx` (`vendor_category_id`),
  1528. CONSTRAINT `fk_vendors_1` FOREIGN KEY (`vendor_category_id`) REFERENCES `vendor_categories` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1529. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1530. /*!40101 SET character_set_client = @saved_cs_client */;
  1531.  
  1532. --
  1533. -- Dumping data for table `vendors`
  1534. --
  1535.  
  1536. LOCK TABLES `vendors` WRITE;
  1537. /*!40000 ALTER TABLE `vendors` DISABLE KEYS */;
  1538. /*!40000 ALTER TABLE `vendors` ENABLE KEYS */;
  1539. UNLOCK TABLES;
  1540.  
  1541. --
  1542. -- Table structure for table `work_orders`
  1543. --
  1544.  
  1545. DROP TABLE IF EXISTS `work_orders`;
  1546. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1547. /*!40101 SET character_set_client = utf8 */;
  1548. CREATE TABLE `work_orders` (
  1549. `id` int(11) NOT NULL,
  1550. `maintenance_request_id` int(11) DEFAULT NULL,
  1551. `hours_worked` double DEFAULT NULL,
  1552. `wage_per_hour` int(11) DEFAULT NULL,
  1553. `fixed_wage_amount_bool` tinyint(1) DEFAULT NULL,
  1554. `fixed_wage_amount` double DEFAULT NULL,
  1555. `total_wage_cost` double DEFAULT NULL,
  1556. `total_costs` double DEFAULT NULL,
  1557. `invoice_img_path` varchar(145) DEFAULT NULL,
  1558. `work_order_creator` int(11) DEFAULT NULL,
  1559. PRIMARY KEY (`id`),
  1560. KEY `fk_work_orders_1_idx` (`work_order_creator`),
  1561. CONSTRAINT `fk_work_orders_1` FOREIGN KEY (`work_order_creator`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1562. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1563. /*!40101 SET character_set_client = @saved_cs_client */;
  1564.  
  1565. --
  1566. -- Dumping data for table `work_orders`
  1567. --
  1568.  
  1569. LOCK TABLES `work_orders` WRITE;
  1570. /*!40000 ALTER TABLE `work_orders` DISABLE KEYS */;
  1571. /*!40000 ALTER TABLE `work_orders` ENABLE KEYS */;
  1572. UNLOCK TABLES;
  1573.  
  1574. --
  1575. -- Table structure for table `work_orders_expenses`
  1576. --
  1577.  
  1578. DROP TABLE IF EXISTS `work_orders_expenses`;
  1579. /*!40101 SET @saved_cs_client = @@character_set_client */;
  1580. /*!40101 SET character_set_client = utf8 */;
  1581. CREATE TABLE `work_orders_expenses` (
  1582. `id` int(11) NOT NULL,
  1583. `expense_name` varchar(45) DEFAULT NULL,
  1584. `expense_cost` double DEFAULT NULL,
  1585. `work_order_id` int(11) DEFAULT NULL,
  1586. PRIMARY KEY (`id`),
  1587. KEY `fk_work_orders_expenses_1_idx` (`work_order_id`),
  1588. CONSTRAINT `fk_work_orders_expenses_1` FOREIGN KEY (`work_order_id`) REFERENCES `work_orders` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  1589. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1590. /*!40101 SET character_set_client = @saved_cs_client */;
  1591.  
  1592. --
  1593. -- Dumping data for table `work_orders_expenses`
  1594. --
  1595.  
  1596. LOCK TABLES `work_orders_expenses` WRITE;
  1597. /*!40000 ALTER TABLE `work_orders_expenses` DISABLE KEYS */;
  1598. /*!40000 ALTER TABLE `work_orders_expenses` ENABLE KEYS */;
  1599. UNLOCK TABLES;
  1600. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  1601.  
  1602. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  1603. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  1604. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  1605. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  1606. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  1607. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  1608. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  1609.  
  1610. -- Dump completed on 2015-04-20 12:58:56
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement