Skip to content

Commit

Permalink
Migration Framework (#9)
Browse files Browse the repository at this point in the history
* Configure flyway gradle

* Move and rename sql migration files
  • Loading branch information
MarloDelatorre authored Aug 7, 2024
1 parent 677de21 commit c11ae3c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 16 deletions.
37 changes: 32 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath "org.flywaydb:flyway-mysql:10.17.0"
}
}

plugins {
id 'application'
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.flywaydb.flyway' version '10.17.0'
}

repositories {
mavenCentral()
gradlePluginPortal()

maven {
url "https://download.red-gate.com/maven/release"
}
}

dependencies {
Expand Down Expand Up @@ -39,10 +54,6 @@ dependencies {
testImplementation 'org.mockito:mockito-junit-jupiter:5.11.0'
}

test {
useJUnitPlatform()
}

application {
mainClass = 'net.server.Server'
}
Expand All @@ -53,6 +64,22 @@ jar {
}
}

flyway {
url = System.getenv('DB_URL')
user = System.getenv('DB_USER')
password = System.getenv('DB_PASS')
cleanDisabled = false
}

build {
dependsOn shadowJar
}

test {
useJUnitPlatform()
}

task runJar(type: Exec) {
dependsOn build
commandLine 'java', '-Xmx2048m', '-Dwz-path=wz', '-jar', 'build/libs/AshesMS-all.jar'
}
7 changes: 0 additions & 7 deletions database/seed/readme.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

DROP DATABASE IF EXISTS `ashes`;
CREATE DATABASE `ashes` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `ashes`;

CREATE TABLE IF NOT EXISTS `accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(13) NOT NULL DEFAULT '',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c11ae3c

Please sign in to comment.