From 93c5431c0f5215c2a66e67a1d7182fd59dfc9139 Mon Sep 17 00:00:00 2001 From: ProgramistaZpolski Date: Sat, 20 Jul 2024 09:38:06 +0200 Subject: [PATCH] Change database driver to MySQL --- build.gradle.kts | 2 +- .../kotlin/io/github/wulkanowy/schools/DatabaseFactory.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c60df7e..3fce63d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -46,7 +46,7 @@ dependencies { implementation("org.jetbrains.exposed:exposed-dao:$exposed_version") implementation("org.jetbrains.exposed:exposed-jdbc:$exposed_version") implementation("org.jetbrains.exposed:exposed-java-time:$exposed_version") - implementation("org.postgresql:postgresql:42.7.2") + implementation("mysql:mysql-connector-java:8.0.33") implementation("org.flywaydb:flyway-core:9.22.2") implementation("io.ktor:ktor-server-auth-jvm:2.3.4") diff --git a/src/main/kotlin/io/github/wulkanowy/schools/DatabaseFactory.kt b/src/main/kotlin/io/github/wulkanowy/schools/DatabaseFactory.kt index 4b5d7f7..a491d72 100644 --- a/src/main/kotlin/io/github/wulkanowy/schools/DatabaseFactory.kt +++ b/src/main/kotlin/io/github/wulkanowy/schools/DatabaseFactory.kt @@ -11,11 +11,11 @@ import org.jetbrains.exposed.sql.transactions.transaction object DatabaseFactory { fun init() { val host = System.getenv("DB_HOST") - val user = "postgres" - val password = "postgres" + val user = "mysql" + val password = "mysql" val database = Database.connect( - url = "jdbc:postgresql://$host:5432/schools", - driver = "org.postgresql.Driver", + url = "jdbc:mysql://$host:3306/schools", + driver = "com.mysql.cj.jdbc.Driver", user = user, password = password, )