Skip to content
Snippets Groups Projects
Commit e06c7cd0 authored by Pedro Pablo Cardona Arroyave's avatar Pedro Pablo Cardona Arroyave
Browse files

Merge branch 'feature/changeNameOfEntities' into 'main'

Name of the colummns were changed to the name of the database.

See merge request idatt2106-v23-03/backend!31
parents 93473f73 c11cd799
No related branches found
No related tags found
No related merge requests found
...@@ -25,8 +25,8 @@ import lombok.NoArgsConstructor; ...@@ -25,8 +25,8 @@ import lombok.NoArgsConstructor;
public class Allergy{ public class Allergy{
@Id @Id
@Column(name = "name") @Column(name = "allergy_name")
String name; String name;
@Column(name = "description") @Column(name = "allergy_description")
String description; String description;
} }
\ No newline at end of file
...@@ -23,9 +23,9 @@ import lombok.NoArgsConstructor; ...@@ -23,9 +23,9 @@ import lombok.NoArgsConstructor;
public class Fridge{ public class Fridge{
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "fridgeId") @Column(name = "fridge_id")
long fridgeId; long fridgeId;
@Column(name = "groupId") @Column(name = "group_id")
long groupId; long groupId;
} }
...@@ -23,11 +23,12 @@ import lombok.NoArgsConstructor; ...@@ -23,11 +23,12 @@ import lombok.NoArgsConstructor;
public class Recipe { public class Recipe {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "recipe_id")
long id; long id;
@Column(name = "name") @Column(name = "recipe_name")
String name; String name;
@Column(name = "description") @Column(name = "recipe_description")
String description; String description;
} }
...@@ -24,8 +24,9 @@ import lombok.NoArgsConstructor; ...@@ -24,8 +24,9 @@ import lombok.NoArgsConstructor;
public class ShoppingList { public class ShoppingList {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "shopping_list_id")
long ShoppingListID; long ShoppingListID;
@Column(name = "groupID") @Column(name = "group_id")
long groupID; long groupID;
} }
...@@ -27,7 +27,7 @@ import java.util.List; ...@@ -27,7 +27,7 @@ import java.util.List;
@Builder @Builder
public class User implements UserDetails { public class User implements UserDetails {
@Id @Id
@Column(name = "user_name") @Column(name = "username")
private String username; private String username;
@Column(name = "password") @Column(name = "password")
private String password; private String password;
......
...@@ -19,33 +19,6 @@ VALUES ...@@ -19,33 +19,6 @@ VALUES
('mike', '{noop}password666', true, 'Mike', 'Taylor', 'USER', 'mike@example.com', '2008-09-09', 5), ('mike', '{noop}password666', true, 'Mike', 'Taylor', 'USER', 'mike@example.com', '2008-09-09', 5),
('olivia', '{noop}password777', true, 'Olivia', 'Clark', 'USER', 'olivia@example.com', '2010-10-10', 5); ('olivia', '{noop}password777', true, 'Olivia', 'Clark', 'USER', 'olivia@example.com', '2010-10-10', 5);
INSERT INTO authorities (username, authority)
VALUES
('john', 'USER'),
('jane', 'ADMIN'),
('bob', 'USER'),
('alice', 'USER'),
('tom', 'USER'),
('sarah', 'USER'),
('david', 'ADMIN'),
('emily', 'USER'),
('mike', 'USER'),
('olivia', 'ADMIN');
INSERT INTO profiles (username, first_name, last_name,email, birthdate, group_id)
VALUES
('john','John','Smith','johnSmith@gmail.com','1998-05-07',1),
('jane','jane','Lee','HappyJane@gmail.com','1973-02-14',1),
('bob','Bob','Garcia','BigGarcia@gmail.com','1958-12-23',2),
('alice','Alice','Lee','johnSmit2h@gmail.com','2002-01-04',2),
('tom','Tom','Johnson','johnSmith3@gmail.com','1993-11-21',3),
('sarah', 'Sarah', 'Taylor', 'sarahTaylor@gmail.com', '1987-09-18',3),
('david', 'David', 'Miller', 'davidMiller@gmail.com', '1979-07-25',4),
('emily', 'Emily', 'Chen', 'emilyChen@gmail.com', '1990-03-12',4),
('mike', 'Mike', 'Johnson', 'mikeJohnson@gmail.com', '1985-06-30',5),
('olivia', 'Olivia', 'Davis', 'oliviaDavis@gmail.com', '2000-10-15',5);
INSERT INTO messages (senderName, group_id, message, is_deleted) INSERT INTO messages (senderName, group_id, message, is_deleted)
VALUES VALUES
('john', 1, 'Hello everyone!', false), ('john', 1, 'Hello everyone!', false),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment