Skip to content

Commit

Permalink
users have roles now, user and admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Isuru2701 committed Oct 27, 2023
1 parent 9f6a9e1 commit 18ab811
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@
## Database
```mysql
create database Users;
create table user_tlb(id int primary key auto_increment,name varchar(40),email varchar(50),password varchar(60));
create table user_tlb
(
id int primary key auto_increment,
name varchar(40),
email varchar(50),
password varchar(60),
role varchar(20) default 'USER'
);
```
3 changes: 3 additions & 0 deletions src/main/java/userservice/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ public class User {

@Column(name = "password")
private String password;

@Column(name = "role", columnDefinition = "varchar(20) default 'USER'")
private String role;

}

0 comments on commit 18ab811

Please sign in to comment.