-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #541 from Lapzupi/database-multiple
Refactored Database, Fixed Migrations
- Loading branch information
Showing
71 changed files
with
5,005 additions
and
1,181 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
plugins { | ||
id("com.oheers.evenmorefish.java-conventions") | ||
} | ||
|
||
|
||
dependencies { | ||
compileOnly(libs.jooq) | ||
compileOnly(libs.jooq.codegen) | ||
|
||
implementation(libs.annotations) | ||
} |
32 changes: 32 additions & 0 deletions
32
...h-database-extras/src/main/java/com/oheers/fish/database/extras/PrefixNamingStrategy.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,32 @@ | ||
package com.oheers.fish.database.extras; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jooq.codegen.DefaultGeneratorStrategy; | ||
import org.jooq.meta.Definition; | ||
import org.jooq.tools.StringUtils; | ||
|
||
// This is needed to ensure prefix placeholders don't stay during code generation. | ||
public class PrefixNamingStrategy extends DefaultGeneratorStrategy { | ||
|
||
@Override | ||
public String getJavaClassName(final Definition definition, final Mode mode) { | ||
String name = replacePrefix(super.getJavaClassName(definition, mode)); | ||
|
||
return StringUtils.toUC(name); | ||
} | ||
|
||
@Override | ||
public String getJavaIdentifier(final Definition definition) { | ||
return replacePrefix(super.getJavaIdentifier(definition)); | ||
} | ||
|
||
private @NotNull String replacePrefix(final @NotNull String name) { | ||
return name | ||
.replaceAll("\\$\\{(TABLEPREFIX|tablePrefix|table_Prefix|TABLE_PREFIX)}", "") // Matches variations of ${TABLEPREFIX} | ||
.replaceAll("\\$_7b(TABLEPREFIX|tablePrefix|table_Prefix|TABLE_PREFIX)_7d", "") // Matches variations of $_7bTABLEPREFIX_7d | ||
.replaceAll("\\$\\{.*?}", "") // Generic fallback for any unmatched ${PLACEHOLDER} | ||
.replaceAll("\\$_7b.*?_7d", ""); // Generic fallback for any unmatched $_7bPLACEHOLDER_7d | ||
} | ||
|
||
|
||
} |
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
54 changes: 54 additions & 0 deletions
54
...sh-plugin/src/main/generated/com/oheers/fish/database/generated/mysql/DefaultCatalog.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
...ish-plugin/src/main/generated/com/oheers/fish/database/generated/mysql/DefaultSchema.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
even-more-fish-plugin/src/main/generated/com/oheers/fish/database/generated/mysql/Keys.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.