-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8dc776d
commit d43876a
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/db/migration/V202410026__Add_administration_costs.java
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,27 @@ | ||
package db.migration; | ||
|
||
import org.flywaydb.core.api.migration.BaseJavaMigration; | ||
import org.flywaydb.core.api.migration.Context; | ||
|
||
import java.sql.Statement; | ||
|
||
|
||
/** | ||
* DB migration which adds Transaction cost field. | ||
*/ | ||
public class V202410026__Add_administration_costs extends BaseJavaMigration { | ||
|
||
/** | ||
* Executes this migration. The execution will automatically take place within a transaction, when the underlying | ||
* database supports it. | ||
* | ||
* @param context of type Context | ||
* @throws Exception when something is wrong | ||
*/ | ||
public void migrate(Context context) throws Exception { | ||
try (Statement select = context.getConnection().createStatement()) { | ||
select.execute("ALTER TABLE public.orders ADD COLUMN administrationCosts DOUBLE PRECISION NOT NULL DEFAULT 0"); | ||
} | ||
} | ||
|
||
} |