-
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.
* Add external product URL to Event * Add rendering of external URL when there is one * Add rendering of external URL on event page * Fix double text in external product url field * Add validation checking for both products and url in one event * Add validation checking for both products and url in one event in admin panel * Add migration for external_product_url in event table * Update script.min * Remove description from external url event in webshop overview
- Loading branch information
1 parent
d0aee28
commit 2f72176
Showing
12 changed files
with
130 additions
and
4 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
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
29 changes: 29 additions & 0 deletions
29
src/main/java/db/migration/V202304016__Add_external_product_url_to_event.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,29 @@ | ||
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 an external product URL to an event. | ||
* If it is present, the event will have a button to this URL instead of normal prducts. | ||
*/ | ||
public class V202304016__Add_external_product_url_to_event 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.event ADD COLUMN external_product_url varchar(255)"); | ||
select.execute("UPDATE public.event SET external_product_url = NULL"); | ||
} | ||
} | ||
|
||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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