Advertisement
adewaleA4

Untitled

Mar 26th, 2015
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.50 KB | None | 0 0
  1. -- MySQL dump 10.13 Distrib 5.5.37, for debian-linux-gnu (x86_64)
  2. --
  3. -- Host: localhost Database: bom-heritage
  4. -- ------------------------------------------------------
  5. -- Server version 5.5.37-0ubuntu0.14.04.1
  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 `account_opening`
  20. --
  21. use bom-heritage;
  22. DROP TABLE IF EXISTS `account_opening`;
  23. /*!40101 SET @saved_cs_client = @@character_set_client */;
  24. /*!40101 SET character_set_client = utf8 */;
  25. CREATE TABLE `account_opening` (
  26. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  27. `request_date` datetime DEFAULT NULL,
  28. `location` varchar(255) DEFAULT NULL,
  29. `first_name` varchar(255) DEFAULT NULL,
  30. `last_name` varchar(255) DEFAULT NULL,
  31. `middle_name` varchar(255) DEFAULT NULL,
  32. `address` varchar(255) DEFAULT NULL,
  33. `email` varchar(255) DEFAULT NULL,
  34. `gender` varchar(255) DEFAULT NULL,
  35. `salutation` varchar(255) DEFAULT NULL,
  36. `phone_number` varchar(255) DEFAULT NULL,
  37. `date_of_birth` datetime DEFAULT NULL,
  38. `response_code` varchar(255) DEFAULT NULL,
  39. `response_message` varchar(255) DEFAULT NULL,
  40. `is_offline` tinyint(1) DEFAULT '0',
  41. `response_date` datetime DEFAULT NULL,
  42. `dsa_id` bigint(20) DEFAULT NULL,
  43. `device_id` bigint(20) DEFAULT NULL,
  44. PRIMARY KEY (`id`),
  45. KEY `ix_account_opening_dsa_1` (`dsa_id`),
  46. KEY `ix_account_opening_device_2` (`device_id`),
  47. CONSTRAINT `fk_account_opening_device_2` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`),
  48. CONSTRAINT `fk_account_opening_dsa_1` FOREIGN KEY (`dsa_id`) REFERENCES `dsa` (`id`)
  49. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  50. /*!40101 SET character_set_client = @saved_cs_client */;
  51.  
  52. --
  53. -- Dumping data for table `account_opening`
  54. --
  55.  
  56. LOCK TABLES `account_opening` WRITE;
  57. /*!40000 ALTER TABLE `account_opening` DISABLE KEYS */;
  58. /*!40000 ALTER TABLE `account_opening` ENABLE KEYS */;
  59. UNLOCK TABLES;
  60.  
  61. --
  62. -- Table structure for table `audit_trail`
  63. --
  64.  
  65. DROP TABLE IF EXISTS `audit_trail`;
  66. /*!40101 SET @saved_cs_client = @@character_set_client */;
  67. /*!40101 SET character_set_client = utf8 */;
  68. CREATE TABLE `audit_trail` (
  69. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  70. `event` varchar(255) DEFAULT NULL,
  71. `message` varchar(255) DEFAULT NULL,
  72. `user_id` bigint(20) DEFAULT NULL,
  73. `event_date` datetime DEFAULT NULL,
  74. `additional` varchar(255) DEFAULT NULL,
  75. `affected_entity_id` bigint(20) DEFAULT NULL,
  76. `device_id` bigint(20) DEFAULT NULL,
  77. `ip_address` varchar(255) DEFAULT NULL,
  78. `username` varchar(255) DEFAULT NULL,
  79. PRIMARY KEY (`id`),
  80. KEY `ix_audit_trail_user_3` (`user_id`),
  81. KEY `ix_audit_trail_device_4` (`device_id`),
  82. CONSTRAINT `fk_audit_trail_device_4` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`),
  83. CONSTRAINT `fk_audit_trail_user_3` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
  84. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  85. /*!40101 SET character_set_client = @saved_cs_client */;
  86.  
  87. --
  88. -- Dumping data for table `audit_trail`
  89. --
  90.  
  91. LOCK TABLES `audit_trail` WRITE;
  92. /*!40000 ALTER TABLE `audit_trail` DISABLE KEYS */;
  93. INSERT INTO `audit_trail` VALUES (1,'FAILED_AUTH','FAILED LOGIN ATTEMPT USING USERNAME admin',NULL,'2015-03-26 09:04:01',NULL,0,NULL,'127.0.0.1','admin'),(2,'FAILED_AUTH','FAILED LOGIN ATTEMPT USING USERNAME admin',NULL,'2015-03-26 09:04:49',NULL,0,NULL,'127.0.0.1','admin'),(3,'LOGIN_OK',NULL,1,'2015-03-26 09:05:52',NULL,0,NULL,'127.0.0.1',NULL);
  94. /*!40000 ALTER TABLE `audit_trail` ENABLE KEYS */;
  95. UNLOCK TABLES;
  96.  
  97. --
  98. -- Table structure for table `branch`
  99. --
  100.  
  101. DROP TABLE IF EXISTS `branch`;
  102. /*!40101 SET @saved_cs_client = @@character_set_client */;
  103. /*!40101 SET character_set_client = utf8 */;
  104. CREATE TABLE `branch` (
  105. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  106. `branch_name` varchar(255) DEFAULT NULL,
  107. `branch_code` varchar(255) DEFAULT NULL,
  108. `is_enabled` tinyint(1) DEFAULT '0',
  109. PRIMARY KEY (`id`)
  110. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  111. /*!40101 SET character_set_client = @saved_cs_client */;
  112.  
  113. --
  114. -- Dumping data for table `branch`
  115. --
  116.  
  117. LOCK TABLES `branch` WRITE;
  118. /*!40000 ALTER TABLE `branch` DISABLE KEYS */;
  119. INSERT INTO `branch` VALUES (1,'HQ','001',1);
  120. /*!40000 ALTER TABLE `branch` ENABLE KEYS */;
  121. UNLOCK TABLES;
  122.  
  123. --
  124. -- Table structure for table `config`
  125. --
  126.  
  127. DROP TABLE IF EXISTS `config`;
  128. /*!40101 SET @saved_cs_client = @@character_set_client */;
  129. /*!40101 SET character_set_client = utf8 */;
  130. CREATE TABLE `config` (
  131. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  132. `config_name` varchar(255) DEFAULT NULL,
  133. `config_value` int(11) DEFAULT NULL,
  134. PRIMARY KEY (`id`)
  135. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
  136. /*!40101 SET character_set_client = @saved_cs_client */;
  137.  
  138. --
  139. -- Dumping data for table `config`
  140. --
  141.  
  142. LOCK TABLES `config` WRITE;
  143. /*!40000 ALTER TABLE `config` DISABLE KEYS */;
  144. INSERT INTO `config` VALUES (1,'ALLOW_TRAN_WEEKEND',1),(2,'ALLOW_ACCOUNT_OPENING_WEEKEND',0),(3,'CUSTOMER_DEPOSIT_LIMIT',10000),(4,'OFFLINE_ACCOUNT_OPENING',0),(5,'CUSTOMER_DEPOSIT_LIMIT_VELOCITY',5),(6,'DSA_DEPOSIT_LIMIT',20000),(7,'DSA_DEPOSIT_VELOCITY_LIMIT',5),(8,'CUSTOMER_WITHDRAWAL_LIMIT_VELOCITY',2),(9,'CUSTOMER_WITHDRAWAL_LIMIT',2000);
  145. /*!40000 ALTER TABLE `config` ENABLE KEYS */;
  146. UNLOCK TABLES;
  147.  
  148. --
  149. -- Table structure for table `device`
  150. --
  151.  
  152. DROP TABLE IF EXISTS `device`;
  153. /*!40101 SET @saved_cs_client = @@character_set_client */;
  154. /*!40101 SET character_set_client = utf8 */;
  155. CREATE TABLE `device` (
  156. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  157. `brand` varchar(255) DEFAULT NULL,
  158. `model` varchar(255) DEFAULT NULL,
  159. `os` varchar(255) DEFAULT NULL,
  160. `device_uid` varchar(255) DEFAULT NULL,
  161. `is_enabled` tinyint(1) DEFAULT '0',
  162. `dsa_id` bigint(20) DEFAULT NULL,
  163. PRIMARY KEY (`id`),
  164. KEY `ix_device_dsa_5` (`dsa_id`),
  165. CONSTRAINT `fk_device_dsa_5` FOREIGN KEY (`dsa_id`) REFERENCES `dsa` (`id`)
  166. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  167. /*!40101 SET character_set_client = @saved_cs_client */;
  168.  
  169. --
  170. -- Dumping data for table `device`
  171. --
  172.  
  173. LOCK TABLES `device` WRITE;
  174. /*!40000 ALTER TABLE `device` DISABLE KEYS */;
  175. /*!40000 ALTER TABLE `device` ENABLE KEYS */;
  176. UNLOCK TABLES;
  177.  
  178. --
  179. -- Table structure for table `device_history`
  180. --
  181.  
  182. DROP TABLE IF EXISTS `device_history`;
  183. /*!40101 SET @saved_cs_client = @@character_set_client */;
  184. /*!40101 SET character_set_client = utf8 */;
  185. CREATE TABLE `device_history` (
  186. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  187. `event_type` varchar(255) DEFAULT NULL,
  188. `ip_address` varchar(255) DEFAULT NULL,
  189. `user_id` bigint(20) DEFAULT NULL,
  190. `device_id` bigint(20) DEFAULT NULL,
  191. `event_date` datetime NOT NULL,
  192. PRIMARY KEY (`id`),
  193. KEY `ix_device_history_user_6` (`user_id`),
  194. KEY `ix_device_history_device_7` (`device_id`),
  195. CONSTRAINT `fk_device_history_device_7` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`),
  196. CONSTRAINT `fk_device_history_user_6` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
  197. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  198. /*!40101 SET character_set_client = @saved_cs_client */;
  199.  
  200. --
  201. -- Dumping data for table `device_history`
  202. --
  203.  
  204. LOCK TABLES `device_history` WRITE;
  205. /*!40000 ALTER TABLE `device_history` DISABLE KEYS */;
  206. /*!40000 ALTER TABLE `device_history` ENABLE KEYS */;
  207. UNLOCK TABLES;
  208.  
  209. --
  210. -- Table structure for table `dsa`
  211. --
  212.  
  213. DROP TABLE IF EXISTS `dsa`;
  214. /*!40101 SET @saved_cs_client = @@character_set_client */;
  215. /*!40101 SET character_set_client = utf8 */;
  216. CREATE TABLE `dsa` (
  217. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  218. `till_account` varchar(255) DEFAULT NULL,
  219. `user_id` bigint(20) NOT NULL,
  220. PRIMARY KEY (`id`),
  221. KEY `ix_dsa_user_8` (`user_id`),
  222. CONSTRAINT `fk_dsa_user_8` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
  223. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  224. /*!40101 SET character_set_client = @saved_cs_client */;
  225.  
  226. --
  227. -- Dumping data for table `dsa`
  228. --
  229.  
  230. LOCK TABLES `dsa` WRITE;
  231. /*!40000 ALTER TABLE `dsa` DISABLE KEYS */;
  232. INSERT INTO `dsa` VALUES (1,'33333',1);
  233. /*!40000 ALTER TABLE `dsa` ENABLE KEYS */;
  234. UNLOCK TABLES;
  235.  
  236. --
  237. -- Table structure for table `holiday`
  238. --
  239.  
  240. DROP TABLE IF EXISTS `holiday`;
  241. /*!40101 SET @saved_cs_client = @@character_set_client */;
  242. /*!40101 SET character_set_client = utf8 */;
  243. CREATE TABLE `holiday` (
  244. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  245. `name` varchar(255) DEFAULT NULL,
  246. `start_date` datetime DEFAULT NULL,
  247. `end_date` datetime DEFAULT NULL,
  248. `is_enabled` tinyint(1) DEFAULT '0',
  249. PRIMARY KEY (`id`)
  250. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  251. /*!40101 SET character_set_client = @saved_cs_client */;
  252.  
  253. --
  254. -- Dumping data for table `holiday`
  255. --
  256.  
  257. LOCK TABLES `holiday` WRITE;
  258. /*!40000 ALTER TABLE `holiday` DISABLE KEYS */;
  259. /*!40000 ALTER TABLE `holiday` ENABLE KEYS */;
  260. UNLOCK TABLES;
  261.  
  262. --
  263. -- Table structure for table `holiday_history`
  264. --
  265.  
  266. DROP TABLE IF EXISTS `holiday_history`;
  267. /*!40101 SET @saved_cs_client = @@character_set_client */;
  268. /*!40101 SET character_set_client = utf8 */;
  269. CREATE TABLE `holiday_history` (
  270. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  271. `event_type` varchar(255) DEFAULT NULL,
  272. `ip_address` varchar(255) DEFAULT NULL,
  273. `user_id` bigint(20) DEFAULT NULL,
  274. `holiday_id` bigint(20) DEFAULT NULL,
  275. `event_date` datetime NOT NULL,
  276. PRIMARY KEY (`id`),
  277. KEY `ix_holiday_history_user_9` (`user_id`),
  278. KEY `ix_holiday_history_holiday_10` (`holiday_id`),
  279. CONSTRAINT `fk_holiday_history_holiday_10` FOREIGN KEY (`holiday_id`) REFERENCES `holiday` (`id`),
  280. CONSTRAINT `fk_holiday_history_user_9` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
  281. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  282. /*!40101 SET character_set_client = @saved_cs_client */;
  283.  
  284. --
  285. -- Dumping data for table `holiday_history`
  286. --
  287.  
  288. LOCK TABLES `holiday_history` WRITE;
  289. /*!40000 ALTER TABLE `holiday_history` DISABLE KEYS */;
  290. /*!40000 ALTER TABLE `holiday_history` ENABLE KEYS */;
  291. UNLOCK TABLES;
  292.  
  293. --
  294. -- Table structure for table `igroup`
  295. --
  296.  
  297. DROP TABLE IF EXISTS `igroup`;
  298. /*!40101 SET @saved_cs_client = @@character_set_client */;
  299. /*!40101 SET character_set_client = utf8 */;
  300. CREATE TABLE `igroup` (
  301. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  302. `name` varchar(255) DEFAULT NULL,
  303. `description` varchar(255) DEFAULT NULL,
  304. PRIMARY KEY (`id`)
  305. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  306. /*!40101 SET character_set_client = @saved_cs_client */;
  307.  
  308. --
  309. -- Dumping data for table `igroup`
  310. --
  311.  
  312. LOCK TABLES `igroup` WRITE;
  313. /*!40000 ALTER TABLE `igroup` DISABLE KEYS */;
  314. /*!40000 ALTER TABLE `igroup` ENABLE KEYS */;
  315. UNLOCK TABLES;
  316.  
  317. --
  318. -- Table structure for table `license`
  319. --
  320.  
  321. DROP TABLE IF EXISTS `license`;
  322. /*!40101 SET @saved_cs_client = @@character_set_client */;
  323. /*!40101 SET character_set_client = utf8 */;
  324. CREATE TABLE `license` (
  325. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  326. `license_name` varchar(255) DEFAULT NULL,
  327. `license_value` int(11) DEFAULT NULL,
  328. PRIMARY KEY (`id`)
  329. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  330. /*!40101 SET character_set_client = @saved_cs_client */;
  331.  
  332. --
  333. -- Dumping data for table `license`
  334. --
  335.  
  336. LOCK TABLES `license` WRITE;
  337. /*!40000 ALTER TABLE `license` DISABLE KEYS */;
  338. /*!40000 ALTER TABLE `license` ENABLE KEYS */;
  339. UNLOCK TABLES;
  340.  
  341. --
  342. -- Table structure for table `location`
  343. --
  344.  
  345. DROP TABLE IF EXISTS `location`;
  346. /*!40101 SET @saved_cs_client = @@character_set_client */;
  347. /*!40101 SET character_set_client = utf8 */;
  348. CREATE TABLE `location` (
  349. `coordinates` varchar(255) NOT NULL,
  350. `address` varchar(255) DEFAULT NULL,
  351. PRIMARY KEY (`coordinates`)
  352. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  353. /*!40101 SET character_set_client = @saved_cs_client */;
  354.  
  355. --
  356. -- Dumping data for table `location`
  357. --
  358.  
  359. LOCK TABLES `location` WRITE;
  360. /*!40000 ALTER TABLE `location` DISABLE KEYS */;
  361. /*!40000 ALTER TABLE `location` ENABLE KEYS */;
  362. UNLOCK TABLES;
  363.  
  364. --
  365. -- Table structure for table `play_evolutions`
  366. --
  367.  
  368. DROP TABLE IF EXISTS `play_evolutions`;
  369. /*!40101 SET @saved_cs_client = @@character_set_client */;
  370. /*!40101 SET character_set_client = utf8 */;
  371. CREATE TABLE `play_evolutions` (
  372. `id` int(11) NOT NULL,
  373. `hash` varchar(255) NOT NULL,
  374. `applied_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  375. `apply_script` text,
  376. `revert_script` text,
  377. `state` varchar(255) DEFAULT NULL,
  378. `last_problem` text,
  379. PRIMARY KEY (`id`)
  380. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  381. /*!40101 SET character_set_client = @saved_cs_client */;
  382.  
  383. --
  384. -- Dumping data for table `play_evolutions`
  385. --
  386.  
  387. LOCK TABLES `play_evolutions` WRITE;
  388. /*!40000 ALTER TABLE `play_evolutions` DISABLE KEYS */;
  389. INSERT INTO `play_evolutions` VALUES (1,'1b5c01c57f11c52862411e795e8afc0243834187','2015-03-26 08:00:38','create table account_opening (\nid bigint auto_increment not null,\nrequest_date datetime,\nlocation varchar(255),\nfirst_name varchar(255),\nlast_name varchar(255),\nmiddle_name varchar(255),\naddress varchar(255),\nemail varchar(255),\ngender varchar(255),\nsalutation varchar(255),\nphone_number varchar(255),\ndate_of_birth datetime,\nresponse_code varchar(255),\nresponse_message varchar(255),\nis_offline tinyint(1) default 0,\nresponse_date datetime,\ndsa_id bigint,\ndevice_id bigint,\nconstraint pk_account_opening primary key (id))\n;\n\ncreate table audit_trail (\nid bigint auto_increment not null,\nevent varchar(255),\nmessage varchar(255),\nuser_id bigint,\nevent_date datetime,\nadditional varchar(255),\naffected_entity_id bigint,\ndevice_id bigint,\nip_address varchar(255),\nusername varchar(255),\nconstraint pk_audit_trail primary key (id))\n;\n\ncreate table branch (\nid bigint auto_increment not null,\nbranch_name varchar(255),\nbranch_code varchar(255),\nis_enabled tinyint(1) default 0,\nconstraint pk_branch primary key (id))\n;\n\ncreate table config (\nid bigint auto_increment not null,\nconfig_name varchar(255),\nconfig_value integer,\nconstraint pk_config primary key (id))\n;\n\ncreate table device (\nid bigint auto_increment not null,\nbrand varchar(255),\nmodel varchar(255),\nos varchar(255),\ndevice_uid varchar(255),\nis_enabled tinyint(1) default 0,\ndsa_id bigint,\nconstraint pk_device primary key (id))\n;\n\ncreate table device_history (\nid bigint auto_increment not null,\nevent_type varchar(255),\nip_address varchar(255),\nuser_id bigint,\ndevice_id bigint,\nevent_date datetime not null,\nconstraint pk_device_history primary key (id))\n;\n\ncreate table dsa (\nid bigint auto_increment not null,\ntill_account varchar(255),\nuser_id bigint not null,\nconstraint pk_dsa primary key (id))\n;\n\ncreate table holiday (\nid bigint auto_increment not null,\nname varchar(255),\nstart_date datetime,\nend_date datetime,\nis_enabled tinyint(1) default 0,\nconstraint pk_holiday primary key (id))\n;\n\ncreate table holiday_history (\nid bigint auto_increment not null,\nevent_type varchar(255),\nip_address varchar(255),\nuser_id bigint,\nholiday_id bigint,\nevent_date datetime not null,\nconstraint pk_holiday_history primary key (id))\n;\n\ncreate table igroup (\nid bigint auto_increment not null,\nname varchar(255),\ndescription varchar(255),\nconstraint pk_igroup primary key (id))\n;\n\ncreate table license (\nid bigint auto_increment not null,\nlicense_name varchar(255),\nlicense_value integer,\nconstraint pk_license primary key (id))\n;\n\ncreate table location (\ncoordinates varchar(255) not null,\naddress varchar(255),\nconstraint pk_location primary key (coordinates))\n;\n\ncreate table privilege (\nid bigint auto_increment not null,\nname varchar(255),\ndescription varchar(255),\nconstraint pk_privilege primary key (id))\n;\n\ncreate table transaction_request (\nid bigint auto_increment not null,\ntran_type varchar(255),\nlocation varchar(255),\ncustomer_account varchar(255),\namount bigint,\ndsa_id bigint,\ndevice_id bigint,\nrequest_date datetime,\nresponse_date datetime,\nresponse_code varchar(255),\nresponse_message varchar(255),\nconstraint pk_transaction_request primary key (id))\n;\n\ncreate table user (\nid bigint auto_increment not null,\nusername varchar(255),\npassword_hash varchar(255),\nis_enabled tinyint(1) default 0,\nbranch_id bigint,\nconstraint uq_user_username unique (username),\nconstraint pk_user primary key (id))\n;\n\ncreate table user_profile (\nid bigint auto_increment not null,\nfirst_name varchar(255),\nlast_name varchar(255),\nmiddle_name varchar(255),\nemail varchar(255),\nphone_number varchar(255),\nstaff_number varchar(255),\nuser_id bigint not null,\nconstraint pk_user_profile primary key (id))\n;\n\n\ncreate table user_privilege (\nprivilege_id bigint not null,\nuser_id bigint not null,\nconstraint pk_user_privilege primary key (privilege_id, user_id))\n;\nalter table account_opening add constraint fk_account_opening_dsa_1 foreign key (dsa_id) references dsa (id) on delete restrict on update restrict;\ncreate index ix_account_opening_dsa_1 on account_opening (dsa_id);\nalter table account_opening add constraint fk_account_opening_device_2 foreign key (device_id) references device (id) on delete restrict on update restrict;\ncreate index ix_account_opening_device_2 on account_opening (device_id);\nalter table audit_trail add constraint fk_audit_trail_user_3 foreign key (user_id) references user (id) on delete restrict on update restrict;\ncreate index ix_audit_trail_user_3 on audit_trail (user_id);\nalter table audit_trail add constraint fk_audit_trail_device_4 foreign key (device_id) references device (id) on delete restrict on update restrict;\ncreate index ix_audit_trail_device_4 on audit_trail (device_id);\nalter table device add constraint fk_device_dsa_5 foreign key (dsa_id) references dsa (id) on delete restrict on update restrict;\ncreate index ix_device_dsa_5 on device (dsa_id);\nalter table device_history add constraint fk_device_history_user_6 foreign key (user_id) references user (id) on delete restrict on update restrict;\ncreate index ix_device_history_user_6 on device_history (user_id);\nalter table device_history add constraint fk_device_history_device_7 foreign key (device_id) references device (id) on delete restrict on update restrict;\ncreate index ix_device_history_device_7 on device_history (device_id);\nalter table dsa add constraint fk_dsa_user_8 foreign key (user_id) references user (id) on delete restrict on update restrict;\ncreate index ix_dsa_user_8 on dsa (user_id);\nalter table holiday_history add constraint fk_holiday_history_user_9 foreign key (user_id) references user (id) on delete restrict on update restrict;\ncreate index ix_holiday_history_user_9 on holiday_history (user_id);\nalter table holiday_history add constraint fk_holiday_history_holiday_10 foreign key (holiday_id) references holiday (id) on delete restrict on update restrict;\ncreate index ix_holiday_history_holiday_10 on holiday_history (holiday_id);\nalter table transaction_request add constraint fk_transaction_request_dsa_11 foreign key (dsa_id) references dsa (id) on delete restrict on update restrict;\ncreate index ix_transaction_request_dsa_11 on transaction_request (dsa_id);\nalter table transaction_request add constraint fk_transaction_request_device_12 foreign key (device_id) references device (id) on delete restrict on update restrict;\ncreate index ix_transaction_request_device_12 on transaction_request (device_id);\nalter table user add constraint fk_user_branch_13 foreign key (branch_id) references branch (id) on delete restrict on update restrict;\ncreate index ix_user_branch_13 on user (branch_id);\nalter table user_profile add constraint fk_user_profile_user_14 foreign key (user_id) references user (id) on delete restrict on update restrict;\ncreate index ix_user_profile_user_14 on user_profile (user_id);\n\n\n\nalter table user_privilege add constraint fk_user_privilege_privilege_01 foreign key (privilege_id) references privilege (id) on delete restrict on update restrict;\n\nalter table user_privilege add constraint fk_user_privilege_user_02 foreign key (user_id) references user (id) on delete restrict on update restrict;','SET FOREIGN_KEY_CHECKS=0;\n\ndrop table account_opening;\n\ndrop table audit_trail;\n\ndrop table branch;\n\ndrop table config;\n\ndrop table device;\n\ndrop table device_history;\n\ndrop table dsa;\n\ndrop table holiday;\n\ndrop table holiday_history;\n\ndrop table igroup;\n\ndrop table license;\n\ndrop table location;\n\ndrop table privilege;\n\ndrop table user_privilege;\n\ndrop table transaction_request;\n\ndrop table user;\n\ndrop table user_profile;\n\nSET FOREIGN_KEY_CHECKS=1;','applied','');
  390. /*!40000 ALTER TABLE `play_evolutions` ENABLE KEYS */;
  391. UNLOCK TABLES;
  392.  
  393. --
  394. -- Table structure for table `privilege`
  395. --
  396.  
  397. DROP TABLE IF EXISTS `privilege`;
  398. /*!40101 SET @saved_cs_client = @@character_set_client */;
  399. /*!40101 SET character_set_client = utf8 */;
  400. CREATE TABLE `privilege` (
  401. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  402. `name` varchar(255) DEFAULT NULL,
  403. `description` varchar(255) DEFAULT NULL,
  404. PRIMARY KEY (`id`)
  405. ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1;
  406. /*!40101 SET character_set_client = @saved_cs_client */;
  407.  
  408. --
  409. -- Dumping data for table `privilege`
  410. --
  411.  
  412. LOCK TABLES `privilege` WRITE;
  413. /*!40000 ALTER TABLE `privilege` DISABLE KEYS */;
  414. INSERT INTO `privilege` VALUES (1,'View Account Opening','User can view account opening'),(2,'View Users','User can view users'),(3,'Update Devices','User can update device information'),(4,'View Audits','User can view application audits'),(5,'Create Users','User can create users'),(6,'Edit Users','User can edit users'),(7,'Disable Users','User can disable users'),(8,'Enable Users','User can enable users'),(9,'View Reports','User can view application reports'),(10,'View Transactions','User can view transactions'),(11,'Update Users','User can update users'),(12,'Create Dsa','User can create dsa'),(13,'View Dsas','User can view dsas'),(14,'Create Branch','User can create branch'),(15,'Edit Branch','User can edit branch'),(16,'View Branch','User can view branches'),(17,'Enable Branch','User can enable branch'),(18,'Disable Branch','User can disable branch'),(19,'View Configuration','User can view configuration'),(20,'Edit Configuration','User can edit configuration'),(21,'View Devices','User can view devices'),(22,'Create Device','User can create device'),(23,'Edit Device','User can edit device'),(24,'Enable Device','User can enable device'),(25,'Disable Device','User can disable device'),(26,'Create Holiday','User can create holiday'),(27,'View Holiday','User can view holiday'),(28,'Edit Holiday','User can view holiday');
  415. /*!40000 ALTER TABLE `privilege` ENABLE KEYS */;
  416. UNLOCK TABLES;
  417.  
  418. --
  419. -- Table structure for table `transaction_request`
  420. --
  421.  
  422. DROP TABLE IF EXISTS `transaction_request`;
  423. /*!40101 SET @saved_cs_client = @@character_set_client */;
  424. /*!40101 SET character_set_client = utf8 */;
  425. CREATE TABLE `transaction_request` (
  426. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  427. `tran_type` varchar(255) DEFAULT NULL,
  428. `location` varchar(255) DEFAULT NULL,
  429. `customer_account` varchar(255) DEFAULT NULL,
  430. `amount` bigint(20) DEFAULT NULL,
  431. `dsa_id` bigint(20) DEFAULT NULL,
  432. `device_id` bigint(20) DEFAULT NULL,
  433. `request_date` datetime DEFAULT NULL,
  434. `response_date` datetime DEFAULT NULL,
  435. `response_code` varchar(255) DEFAULT NULL,
  436. `response_message` varchar(255) DEFAULT NULL,
  437. PRIMARY KEY (`id`),
  438. KEY `ix_transaction_request_dsa_11` (`dsa_id`),
  439. KEY `ix_transaction_request_device_12` (`device_id`),
  440. CONSTRAINT `fk_transaction_request_device_12` FOREIGN KEY (`device_id`) REFERENCES `device` (`id`),
  441. CONSTRAINT `fk_transaction_request_dsa_11` FOREIGN KEY (`dsa_id`) REFERENCES `dsa` (`id`)
  442. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  443. /*!40101 SET character_set_client = @saved_cs_client */;
  444.  
  445. --
  446. -- Dumping data for table `transaction_request`
  447. --
  448.  
  449. LOCK TABLES `transaction_request` WRITE;
  450. /*!40000 ALTER TABLE `transaction_request` DISABLE KEYS */;
  451. /*!40000 ALTER TABLE `transaction_request` ENABLE KEYS */;
  452. UNLOCK TABLES;
  453.  
  454. --
  455. -- Table structure for table `user`
  456. --
  457.  
  458. DROP TABLE IF EXISTS `user`;
  459. /*!40101 SET @saved_cs_client = @@character_set_client */;
  460. /*!40101 SET character_set_client = utf8 */;
  461. CREATE TABLE `user` (
  462. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  463. `username` varchar(255) DEFAULT NULL,
  464. `password_hash` varchar(255) DEFAULT NULL,
  465. `is_enabled` tinyint(1) DEFAULT '0',
  466. `branch_id` bigint(20) DEFAULT NULL,
  467. PRIMARY KEY (`id`),
  468. UNIQUE KEY `uq_user_username` (`username`),
  469. KEY `ix_user_branch_13` (`branch_id`),
  470. CONSTRAINT `fk_user_branch_13` FOREIGN KEY (`branch_id`) REFERENCES `branch` (`id`)
  471. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  472. /*!40101 SET character_set_client = @saved_cs_client */;
  473.  
  474. --
  475. -- Dumping data for table `user`
  476. --
  477.  
  478. LOCK TABLES `user` WRITE;
  479. /*!40000 ALTER TABLE `user` DISABLE KEYS */;
  480. INSERT INTO `user` VALUES (1,'admin','$2a$10$jTLZEU9vlR2r5WhBt4Mr2.yiMLgiY88buL7elDSGrPlHVQA0s6zGe',1,1);
  481. /*!40000 ALTER TABLE `user` ENABLE KEYS */;
  482. UNLOCK TABLES;
  483.  
  484. --
  485. -- Table structure for table `user_privilege`
  486. --
  487.  
  488. DROP TABLE IF EXISTS `user_privilege`;
  489. /*!40101 SET @saved_cs_client = @@character_set_client */;
  490. /*!40101 SET character_set_client = utf8 */;
  491. CREATE TABLE `user_privilege` (
  492. `privilege_id` bigint(20) NOT NULL,
  493. `user_id` bigint(20) NOT NULL,
  494. PRIMARY KEY (`privilege_id`,`user_id`),
  495. KEY `fk_user_privilege_user_02` (`user_id`),
  496. CONSTRAINT `fk_user_privilege_user_02` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
  497. CONSTRAINT `fk_user_privilege_privilege_01` FOREIGN KEY (`privilege_id`) REFERENCES `privilege` (`id`)
  498. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  499. /*!40101 SET character_set_client = @saved_cs_client */;
  500.  
  501. --
  502. -- Dumping data for table `user_privilege`
  503. --
  504.  
  505. LOCK TABLES `user_privilege` WRITE;
  506. /*!40000 ALTER TABLE `user_privilege` DISABLE KEYS */;
  507. INSERT INTO `user_privilege` VALUES (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1),(11,1),(12,1),(13,1),(14,1),(15,1),(16,1),(17,1),(18,1),(19,1),(20,1),(21,1),(22,1),(23,1),(24,1),(25,1),(26,1),(27,1),(28,1);
  508. /*!40000 ALTER TABLE `user_privilege` ENABLE KEYS */;
  509. UNLOCK TABLES;
  510.  
  511. --
  512. -- Table structure for table `user_profile`
  513. --
  514.  
  515. DROP TABLE IF EXISTS `user_profile`;
  516. /*!40101 SET @saved_cs_client = @@character_set_client */;
  517. /*!40101 SET character_set_client = utf8 */;
  518. CREATE TABLE `user_profile` (
  519. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  520. `first_name` varchar(255) DEFAULT NULL,
  521. `last_name` varchar(255) DEFAULT NULL,
  522. `middle_name` varchar(255) DEFAULT NULL,
  523. `email` varchar(255) DEFAULT NULL,
  524. `phone_number` varchar(255) DEFAULT NULL,
  525. `staff_number` varchar(255) DEFAULT NULL,
  526. `user_id` bigint(20) NOT NULL,
  527. PRIMARY KEY (`id`),
  528. KEY `ix_user_profile_user_14` (`user_id`),
  529. CONSTRAINT `fk_user_profile_user_14` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
  530. ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
  531. /*!40101 SET character_set_client = @saved_cs_client */;
  532.  
  533. --
  534. -- Dumping data for table `user_profile`
  535. --
  536.  
  537. LOCK TABLES `user_profile` WRITE;
  538. /*!40000 ALTER TABLE `user_profile` DISABLE KEYS */;
  539. INSERT INTO `user_profile` VALUES (8,'Adewale','Afolabi','A','adewaleafolabi@gmail.com','08025426934','001',1);
  540. /*!40000 ALTER TABLE `user_profile` ENABLE KEYS */;
  541. UNLOCK TABLES;
  542. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  543.  
  544. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  545. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  546. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  547. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  548. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  549. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  550. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  551.  
  552. -- Dump completed on 2015-03-26 9:46:21
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement