diff --git a/database/01_init.sql b/database/01_init.sql index 1687fb2..c76c8b6 100644 --- a/database/01_init.sql +++ b/database/01_init.sql @@ -60,11 +60,12 @@ CREATE TABLE team CREATE TABLE team_member ( - id SERIAL, - user_id INTEGER NOT NULL, - team_id INTEGER NOT NULL, - role VARCHAR(8) NOT NULL, - active BOOLEAN DEFAULT TRUE NOT NULL, + id SERIAL, + user_id INTEGER NOT NULL, + team_id INTEGER NOT NULL, + joined_at TIMESTAMPTZ, + role VARCHAR(8) NOT NULL, + active BOOLEAN DEFAULT TRUE NOT NULL, CONSTRAINT pk_team_member PRIMARY KEY (id), CONSTRAINT fk_team_member_user FOREIGN KEY (user_id) REFERENCES users (id), diff --git a/src/main/java/ch/fhnw/deardevbackend/entities/TeamMember.java b/src/main/java/ch/fhnw/deardevbackend/entities/TeamMember.java index d1d2c94..d112100 100644 --- a/src/main/java/ch/fhnw/deardevbackend/entities/TeamMember.java +++ b/src/main/java/ch/fhnw/deardevbackend/entities/TeamMember.java @@ -6,6 +6,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.time.LocalDateTime; + @Entity @NoArgsConstructor @AllArgsConstructor @@ -23,6 +25,9 @@ public class TeamMember { @Column(name = "team_id") private Integer teamId; + @Column(name = "joined_at") + private LocalDateTime joinedAt; + @Enumerated(EnumType.STRING) @Column(name = "role") private Role role; diff --git a/src/main/java/ch/fhnw/deardevbackend/entities/TeamMemberWithUser.java b/src/main/java/ch/fhnw/deardevbackend/entities/TeamMemberWithUser.java index 0374799..af6ce11 100644 --- a/src/main/java/ch/fhnw/deardevbackend/entities/TeamMemberWithUser.java +++ b/src/main/java/ch/fhnw/deardevbackend/entities/TeamMemberWithUser.java @@ -6,6 +6,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.time.LocalDateTime; + @Entity @NoArgsConstructor @AllArgsConstructor @@ -24,6 +26,9 @@ public class TeamMemberWithUser { @Column(name = "team_id") private Integer teamId; + @Column(name = "joined_at") + private LocalDateTime joinedAt; + @Enumerated(EnumType.STRING) @Column(name = "role") private Role role;