Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 12ca287

Browse files
committed
fixes post mapping
fixes nullable columns for order shipping info table
1 parent 4dfb8e2 commit 12ca287

5 files changed

Lines changed: 26 additions & 44 deletions

File tree

src/main/java/com/zenfulcode/commercify/commercify/controller/OrderController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public ResponseEntity<?> createOrder(@PathVariable Long userId, @RequestBody Cre
6161
}
6262
}
6363

64-
@PostMapping("/")
64+
@PostMapping
6565
public ResponseEntity<?> createOrder(@RequestBody CreateOrderRequest orderRequest) {
6666
try {
6767
OrderDTO orderDTO = orderService.createOrder(orderRequest);

src/main/java/com/zenfulcode/commercify/commercify/entity/OrderShippingInfo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ public class OrderShippingInfo {
1717
@Column(name = "id", nullable = false)
1818
private Long id;
1919

20-
@Column(name = "customer_first_name", nullable = false)
20+
@Column(name = "customer_first_name")
2121
private String customerFirstName;
22-
@Column(name = "customer_last_name", nullable = false)
22+
@Column(name = "customer_last_name")
2323
private String customerLastName;
24-
@Column(name = "customer_email", nullable = false)
24+
@Column(name = "customer_email")
2525
private String customerEmail;
26-
@Column(name = "customer_phone", nullable = false)
26+
@Column(name = "customer_phone")
2727
private String customerPhone;
2828

2929
@Column(name = "shipping_street", nullable = false)

src/main/resources/db/changelog/db.changelog-master.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
<include file="db/changelog/migrations/241127144629-changelog.xml"/>
1313
<include file="db/changelog/migrations/241201215506-changelog.xml"/>
1414
<include file="db/changelog/migrations/241223151914-changelog.xml"/>
15-
<include file="db/changelog/migrations/241228232009-changelog.xml"/>
15+
<include file="db/changelog/migrations/db.changelog-master.xml"/>
1616
</databaseChangeLog>

src/main/resources/db/changelog/migrations/241228232009-changelog.xml

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
6+
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.30.xsd"
7+
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
8+
<changeSet id="1735503484260-2" author="gkhaavik">
9+
<addColumn tableName="order_shipping_info">
10+
<column name="customer_email" type="VARCHAR(255)"/>
11+
<column name="customer_first_name" type="VARCHAR(255)"/>
12+
<column name="customer_last_name" type="VARCHAR(255)"/>
13+
<column name="customer_phone" type="VARCHAR(255)"/>
14+
</addColumn>
15+
</changeSet>
16+
<changeSet id="1735503484260-1" author="gkhaavik">
17+
<dropNotNullConstraint columnDataType="bigint" columnName="user_id" tableName="orders"/>
18+
</changeSet>
19+
20+
</databaseChangeLog>

0 commit comments

Comments
 (0)