data.sql 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. CREATE TABLE IF NOT EXISTS persistent_logins (
  2. username VARCHAR(100) NOT NULL,
  3. series VARCHAR(64) PRIMARY KEY,
  4. token VARCHAR(64) NOT NULL,
  5. last_used TIMESTAMP NOT NULL);
  6. DELETE FROM roles;
  7. DELETE FROM users;
  8. DELETE FROM user_role;
  9. INSERT INTO roles (id, name) VALUES
  10. (1, 'ROLE_ADMIN'),
  11. (2, 'ROLE_ACTUATOR'),
  12. (3, 'ROLE_USER');
  13. INSERT INTO users (id, username, password, name) VALUES
  14. (1, 'admin', '$2a$10$BsbENHEAka/4OMaIY7feoOTv17SmbdCN53BtLdJWgZn14dY8bvieu', 'administrator'),
  15. (3, 'user', '$2a$10$BsbENHEAka/4OMaIY7feoOTv17SmbdCN53BtLdJWgZn14dY8bvieu', 'regular user');
  16. INSERT INTO user_role(user_id, role_id) VALUES
  17. (1,1),
  18. (1,2),
  19. (1,3),
  20. (3,2),
  21. (3,3);
  22. INSERT INTO posts(post_id, title, content, created_on, updated_on) VALUES
  23. (100, 'Introducing SpringBoot','SpringBoot is an opinionated approach for building Spring applications.', '2017-06-20', null),
  24. (101, 'CRUD using Spring Data JPA','Spring Data JPA provides JpaRepository which can be extended to have CRUD operations', '2017-06-25', null),
  25. (102, 'Securing Web apps using SpringSecurity','Spring Security provides Authentication and Authorization support.', '2017-04-20', now());