Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b4a6caf

Browse files
author
ramazansakin
committed
initialize Roles not to get "Role not found errors"
1 parent 3740c4a commit b4a6caf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

‎src/main/resources/application.properties‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
server.port=8080
22
spring.application.name=spring-boot-jwt-auth
33

4-
spring.datasource.url=jdbc:mysql://localhost:3306/testdb?useSSL=false
4+
spring.datasource.url=jdbc:mysql://localhost:3306/testdb
55
spring.datasource.username=root
66
spring.datasource.password=123456
77

88
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
99
spring.jpa.hibernate.ddl-auto=update
10+
spring.sql.init.mode=always
11+
spring.sql.init.schema-locations=classpath:init_roles.sql
1012

1113
# JWT Properties
1214
bezkoder.app.jwtSecret=bezKoderSecretKey

‎src/main/resources/init_roles.sql‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
INSERT INTO roles (name)
2+
VALUES ('ROLE_USER'),
3+
('ROLE_MODERATOR'),
4+
('ROLE_ADMIN') ON DUPLICATE KEY
5+
UPDATE name = name;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /