-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspringmvcwithhibernate.sql
92 lines (68 loc) · 2.94 KB
/
springmvcwithhibernate.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
SQLyog Community v12.4.3 (64 bit)
MySQL - 5.7.19-log : Database - springmvcwithhibernate
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`springmvcwithhibernate` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `springmvcwithhibernate`;
/*Table structure for table `app_user` */
DROP TABLE IF EXISTS `app_user`;
CREATE TABLE `app_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`sso_id` varchar(30) NOT NULL,
`password` varchar(100) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `sso_id` (`sso_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*Data for the table `app_user` */
insert into `app_user`(`id`,`sso_id`,`password`,`first_name`,`last_name`,`email`) values
(1,'faiz','$2a$10$3YhiA66CzW46PeebQArctu03gT8hGlHLfRs/.VB9smrQuDcpuRBIq','Faiz','Akram','faiz@gmail.com');
/*Table structure for table `app_user_user_profile` */
DROP TABLE IF EXISTS `app_user_user_profile`;
CREATE TABLE `app_user_user_profile` (
`user_id` bigint(20) NOT NULL,
`user_profile_id` bigint(20) NOT NULL,
PRIMARY KEY (`user_id`,`user_profile_id`),
KEY `FK_USER_PROFILE` (`user_profile_id`),
CONSTRAINT `FK_APP_USER` FOREIGN KEY (`user_id`) REFERENCES `app_user` (`id`),
CONSTRAINT `FK_USER_PROFILE` FOREIGN KEY (`user_profile_id`) REFERENCES `user_profile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `app_user_user_profile` */
insert into `app_user_user_profile`(`user_id`,`user_profile_id`) values
(1,2);
/*Table structure for table `persistent_logins` */
DROP TABLE IF EXISTS `persistent_logins`;
CREATE TABLE `persistent_logins` (
`username` varchar(64) NOT NULL,
`series` varchar(64) NOT NULL,
`token` varchar(64) NOT NULL,
`last_used` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`series`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `persistent_logins` */
/*Table structure for table `user_profile` */
DROP TABLE IF EXISTS `user_profile`;
CREATE TABLE `user_profile` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `type` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*Data for the table `user_profile` */
insert into `user_profile`(`id`,`type`) values
(2,'ADMIN'),
(3,'DBA'),
(1,'USER');
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;