Skip to content

Commit

Permalink
DEAR-136: add joined_at to team member entity
Browse files Browse the repository at this point in the history
  • Loading branch information
baurnick committed Aug 7, 2024
1 parent 95319bb commit 65e67fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
11 changes: 6 additions & 5 deletions database/01_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ch/fhnw/deardevbackend/entities/TeamMember.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Entity
@NoArgsConstructor
@AllArgsConstructor
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Entity
@NoArgsConstructor
@AllArgsConstructor
Expand All @@ -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;
Expand Down

0 comments on commit 65e67fe

Please sign in to comment.