text: create sequence t1_seq start with 1 increment by 1 nomaxvalue;
  create sequence t2_seq start with 1 increment by 1 nomaxvalue;
  INSERT INTO USER_PROFILE(ID,type)
  VALUES (t1_seq.nextval, 'USER');
  
  INSERT INTO USER_PROFILE(ID,type)
  VALUES (t1_seq.nextval,'DBA');
  INSERT INTO APP_USERS(id,sso_id, password, first_name, last_name, email)
  VALUES (t1_seq.nextval,'PURU','$2a$06$cXoaG0fGDQB4KkBB63qA5.dYESECFNf8/0G5lX1tio8ChW2FjuQQm', 'Purusottam','Singh','puru@xyz.com');
  
  INSERT INTO APP_USER_USER_PROFILE (user_id, user_profile_id)
    SELECT usr.id, profile.ID FROM app_users usr left join user_profile profile
    on usr.sso_id='PURU' and profile.type='ADMIN';
    
    
    CREATE TABLE persistent_logins (
      username VARCHAR(64) NOT NULL,
      series VARCHAR(64) NOT NULL,
      token VARCHAR(64) NOT NULL,
      last_used TIMESTAMP NOT NULL,
      PRIMARY KEY (series)
  );
    
    CREATE TABLE APP_USER_USER_PROFILE (
      user_id INT NOT NULL,
      user_profile_id INT NOT NULL,
      PRIMARY KEY (user_id, user_profile_id),
      CONSTRAINT FK_APP_USER FOREIGN KEY (user_id) REFERENCES APP_USERS (id),
      CONSTRAINT FK_USER_PROFILE FOREIGN KEY (user_profile_id) REFERENCES USER_PROFILE (id)
  );
  
  
  /*All User's gets stored in APP_USER table*/
  create table APP_USER (
     id BIGINT 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 (sso_id)
  );
     
  /* USER_PROFILE table contains all possible roles */ 
  create table USER_PROFILE(
     id BIGINT NOT NULL AUTO_INCREMENT,
     type VARCHAR(30) NOT NULL,
     PRIMARY KEY (id),
     UNIQUE (type)
  );
     
  /* JOIN TABLE for MANY-TO-MANY relationship*/  
  CREATE TABLE APP_USER_USER_PROFILE (
      user_id BIGINT NOT NULL,
      user_profile_id BIGINT NOT NULL,
      PRIMARY KEY (user_id, 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)
  );
    
  /* Populate USER_PROFILE Table */
  INSERT INTO USER_PROFILE(type)
  VALUES ('USER');
    
  INSERT INTO USER_PROFILE(type)
  VALUES ('ADMIN');
    
  INSERT INTO USER_PROFILE(type)
  VALUES ('DBA');
    
    
  /* Populate one Admin User which will further create other users for the application using GUI */
  INSERT INTO APP_USER(sso_id, password, first_name, last_name, email)
  VALUES ('sam','$2a$10$4eqIF5s/ewJwHK1p8lqlFOEm2QIA0S8g6./Lok.pQxqcxaBZYChRm', 'Sam','Smith','samy@xyz.com');
    
    
  /* Populate JOIN Table */
  INSERT INTO APP_USER_USER_PROFILE (user_id, user_profile_id)
    SELECT user.id, profile.id FROM app_user user, user_profile profile
    where user.sso_id='sam' and profile.type='ADMIN';
   
  /* Create persistent_logins Table used to store rememberme related stuff*/
  CREATE TABLE persistent_logins (
      username VARCHAR(64) NOT NULL,
      series VARCHAR(64) NOT NULL,
      token VARCHAR(64) NOT NULL,
      last_used TIMESTAMP NOT NULL,
      PRIMARY KEY (series)
  );