mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
update flyway
This commit is contained in:
1 parent
470e506cb0
commit
dc9d9b06ef
8 files changed
+26
-13
No files matched your search
@@ -97,6 +97,9 @@ abstract class WriteDependencies : DefaultTask() {
|
||||
private fun MutableSet<ResolvedDependencyResult>.addFrom(dependencies: Set<DependencyResult>) {
|
||||
for (dependency in dependencies) {
|
||||
dependency as ResolvedDependencyResult
|
||||
if (dependency.resolvedVariant.attributes.toString().contains("org.gradle.category=platform")) {
|
||||
continue
|
||||
}
|
||||
add(dependency)
|
||||
if (transitive.get()) {
|
||||
addFrom(dependency.selected.dependencies)
|
||||
|
||||
@@ -32,6 +32,12 @@ dependencies {
|
||||
runtimeDownload(libs.assistedInject) {
|
||||
isTransitive = false
|
||||
}
|
||||
runtimeDownload(libs.flyway) {
|
||||
exclude("com.google", "gson")
|
||||
}
|
||||
runtimeDownload(libs.flywayMysql) {
|
||||
isTransitive = false
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -59,6 +59,8 @@ fun Task.standardRuntimeRelocations() {
|
||||
relocateDependency("org.mariadb.jdbc")
|
||||
relocateDependency("org.postgresql")
|
||||
relocateDependency("redis.clients.jedis")
|
||||
relocateDependency("org.flywaydb")
|
||||
relocateDependency("com.fasterxml")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +79,6 @@ fun Task.standardRelocations() {
|
||||
relocateDependency("ninja.egg82.messenger")
|
||||
relocateDependency("org.antlr")
|
||||
relocateDependency("com.electronwill")
|
||||
relocateDependency("org.flywaydb")
|
||||
}
|
||||
|
||||
fun Task.relocateCloud() {
|
||||
|
||||
@@ -36,8 +36,12 @@ dependencies {
|
||||
compileOnlyApi(libs.jdbiObject)
|
||||
compileOnlyApi(libs.jdbiPostgres)
|
||||
api(libs.hikariCP)
|
||||
api(libs.flyway)
|
||||
api(libs.flywayMysql)
|
||||
compileOnlyApi(libs.flyway) {
|
||||
exclude("com.google", "gson")
|
||||
}
|
||||
compileOnlyApi(libs.flywayMysql) {
|
||||
isTransitive = false
|
||||
}
|
||||
|
||||
// Messaging
|
||||
api(libs.messenger)
|
||||
|
||||
+5
-6
@@ -49,8 +49,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.flywaydb.core.internal.database.postgresql.PostgreSQLDatabaseType;
|
||||
import org.flywaydb.core.internal.plugin.PluginRegister;
|
||||
import org.jdbi.v3.core.Jdbi;
|
||||
import org.jdbi.v3.postgres.PostgresPlugin;
|
||||
import org.jdbi.v3.sqlobject.SqlObjectPlugin;
|
||||
@@ -143,7 +141,6 @@ public final class PostgreSQLUserManager extends DatabaseUserManager {
|
||||
|
||||
public PostgreSQLUserManager create() {
|
||||
SQLDrivers.loadFrom(this.getClass().getClassLoader());
|
||||
PluginRegister.REGISTERED_PLUGINS.add(new PostgreSQLDatabaseType());
|
||||
|
||||
final HikariConfig hikariConfig = new HikariConfig();
|
||||
hikariConfig.setMaximumPoolSize(20);
|
||||
@@ -154,15 +151,17 @@ public final class PostgreSQLUserManager extends DatabaseUserManager {
|
||||
|
||||
final DataSource dataSource = new HikariDataSource(hikariConfig);
|
||||
|
||||
Flyway.configure(CarbonChat.class.getClassLoader())
|
||||
final Flyway flyway = Flyway.configure(CarbonChat.class.getClassLoader())
|
||||
.baselineVersion("0")
|
||||
.baselineOnMigrate(true)
|
||||
.locations("queries/migrations/postgresql")
|
||||
.dataSource(dataSource)
|
||||
.validateMigrationNaming(true)
|
||||
.validateOnMigrate(true)
|
||||
.load()
|
||||
.migrate();
|
||||
.load();
|
||||
|
||||
flyway.repair();
|
||||
flyway.migrate();
|
||||
|
||||
final Jdbi jdbi = Jdbi.create(dataSource)
|
||||
.registerArgument(new ComponentArgumentFactory())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CREATE TABLE IF NOT EXISTS carbon_users (
|
||||
CREATE TABLE carbon_users (
|
||||
id uuid NOT NULL PRIMARY KEY,
|
||||
muted BOOLEAN,
|
||||
deafened BOOLEAN,
|
||||
@@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS carbon_users (
|
||||
spying BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS carbon_ignores (
|
||||
CREATE TABLE carbon_ignores (
|
||||
id uuid NOT NULL,
|
||||
ignoredplayer uuid NOT NULL,
|
||||
PRIMARY KEY (id, ignoredplayer)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CREATE TABLE IF NOT EXISTS carbon_leftchannels (
|
||||
CREATE TABLE carbon_leftchannels (
|
||||
id uuid NOT NULL,
|
||||
channel VARCHAR(100) NOT NULL,
|
||||
PRIMARY KEY (id, channel)
|
||||
|
||||
@@ -46,7 +46,7 @@ versions:
|
||||
hikari: 5.0.1
|
||||
mysql: 8.0.33
|
||||
protobuf: 3.21.9
|
||||
flyway: 8.5.13 # DO NOT UPDATE. Something will break.
|
||||
flyway: 9.21.1
|
||||
caffeine: 3.1.7
|
||||
mariadb: 3.0.8
|
||||
messenger: 1.0.0-SNAPSHOT
|
||||
|
||||
Reference in new issue
Block a user