-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented soft delete, liquibase support, delete and update book me…
…thods
- Loading branch information
1 parent
d75993d
commit 08259ac
Showing
11 changed files
with
140 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package mate.academy.dto; | ||
|
||
import java.math.BigDecimal; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class UpdateBookRequestDto { | ||
private String title; | ||
private String author; | ||
private String isbn; | ||
private BigDecimal price; | ||
private String description; | ||
private String coverImage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/resources/db/changelog/changes/01-create-books-table.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: create-book-table | ||
author: mate_academy | ||
changes: | ||
- createTable: | ||
tableName: books | ||
columns: | ||
- column: | ||
name: id | ||
type: BIGINT | ||
autoIncrement: true | ||
constraints: | ||
primaryKey: true | ||
nullable: false | ||
- column: | ||
name: title | ||
type: VARCHAR(255) | ||
constraints: | ||
nullable: false | ||
- column: | ||
name: author | ||
type: VARCHAR(255) | ||
constraints: | ||
nullable: false | ||
- column: | ||
name: isbn | ||
type: VARCHAR(255) | ||
constraints: | ||
nullable: false | ||
unique: true | ||
- column: | ||
name: price | ||
type: DECIMAL(19, 2) | ||
constraints: | ||
nullable: false | ||
- column: | ||
name: description | ||
type: TEXT | ||
- column: | ||
name: cover_image | ||
type: VARCHAR(255) | ||
- column: | ||
name: is_deleted | ||
type: BIT | ||
defaultValueBoolean: false | ||
constraints: | ||
nullable: false |
9 changes: 9 additions & 0 deletions
9
src/main/resources/db/changelog/changes/02-modify-is_deleted-column-type.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: modify-is_deleted-column-type | ||
author: mate_academy | ||
changes: | ||
- modifyDataType: | ||
columnName: is_deleted | ||
newDataType: BIT | ||
tableName: books |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
databaseChangeLog: | ||
- include: | ||
file: db/changelog/changes/01-create-books-table.yaml | ||
- include: | ||
file: db/changelog/changes/02-modify-is_deleted-column-type.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
url=jdbc:mysql://localhost:3306/BookStore | ||
username=root | ||
password=12345678 | ||
changeLogFile=/db/changelog/db.changelog-master.yaml |