This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
1,260 additions
and
1,057 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
ktor_version=2.3.7 | ||
logback_version=1.4.14 | ||
exposed_version=0.45.0 | ||
postgres_version=42.7.1 | ||
hikari_version=5.1.0 | ||
kotest_version=5.8.0 | ||
flyway_version=9.22.3 | ||
ktorVersion=2.3.7 | ||
logbackVersion=1.4.14 | ||
exposedVersion=0.45.0 | ||
postgresVersion=42.7.1 | ||
hikariVersion=5.1.0 | ||
kotestVersion=5.8.0 | ||
flywayVersion=9.22.3 | ||
kotlin.code.style=official |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,26 +32,27 @@ import java.net.URI | |
private const val DEFAULT_DEV_POOL_SIZE = 7 | ||
private const val DEFAULT_PROD_POOL_SIZE = 20 | ||
|
||
val tables: Array<Table> = arrayOf( | ||
Happening, | ||
StudentGroupHappeningRegistration, | ||
Registration, | ||
Answer, | ||
SpotRange, | ||
User, | ||
Feedback, | ||
StudentGroup, | ||
StudentGroupMembership, | ||
Reaction, | ||
WaitingListUUID, | ||
Whitelist | ||
) | ||
val tables: Array<Table> = | ||
arrayOf( | ||
Happening, | ||
StudentGroupHappeningRegistration, | ||
Registration, | ||
Answer, | ||
SpotRange, | ||
User, | ||
Feedback, | ||
StudentGroup, | ||
StudentGroupMembership, | ||
Reaction, | ||
WaitingListUUID, | ||
Whitelist, | ||
) | ||
|
||
class DatabaseHandler( | ||
private val env: Environment, | ||
private val migrateDb: Boolean, | ||
dbUrl: URI, | ||
mbMaxPoolSize: String? | ||
mbMaxPoolSize: String?, | ||
) { | ||
private val dbPort = if (dbUrl.port == -1) 5432 else dbUrl.port | ||
private val dbUrlStr = "jdbc:postgresql://${dbUrl.host}:${dbPort}${dbUrl.path}" | ||
|
@@ -76,7 +77,7 @@ class DatabaseHandler( | |
driverClassName = "org.postgresql.Driver" | ||
connectionTimeout = 1000 | ||
maximumPoolSize = maxPoolSize | ||
} | ||
}, | ||
) | ||
} | ||
|
||
|
@@ -86,7 +87,7 @@ class DatabaseHandler( | |
GIVEN BY THE NAME OF THE SQL FILE IN src/main/resources/db/migration | ||
WITH THE HIGHEST PREFIX. I.E., "V29__xyz_abc.sql" IS VERSION "29". | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
*/ | ||
*/ | ||
private val flyway: Flyway = | ||
Flyway.configure().baselineVersion("31").cleanDisabled(false).dataSource(dbUrlStr, dbUsername, dbPassword) | ||
.load() | ||
|
@@ -131,52 +132,56 @@ class DatabaseHandler( | |
} | ||
|
||
private fun insertTestData() { | ||
val happenings = listOf( | ||
HappeningJson( | ||
"bedriftspresentasjon-med-bekk", | ||
"Bedpres med Bekk", | ||
"021-05-06T16:46+01:00", | ||
"2030-03-09T16:15+01:00", | ||
spotRanges = listOf( | ||
SpotRangeJson( | ||
11, | ||
1, | ||
2 | ||
), | ||
SpotRangeJson( | ||
9, | ||
3, | ||
5 | ||
) | ||
val happenings = | ||
listOf( | ||
HappeningJson( | ||
"bedriftspresentasjon-med-bekk", | ||
"Bedpres med Bekk", | ||
"021-05-06T16:46+01:00", | ||
"2030-03-09T16:15+01:00", | ||
spotRanges = | ||
listOf( | ||
SpotRangeJson( | ||
11, | ||
1, | ||
2, | ||
), | ||
SpotRangeJson( | ||
9, | ||
3, | ||
5, | ||
), | ||
), | ||
HAPPENING_TYPE.BEDPRES, | ||
validStudentGroups[1], | ||
), | ||
HAPPENING_TYPE.BEDPRES, | ||
validStudentGroups[1] | ||
), | ||
HappeningJson( | ||
"fest-med-tilde", | ||
"Fest med Tilde!", | ||
"2021-05-06T16:46+01:00", | ||
"2030-06-02T14:20+01:00", | ||
spotRanges = listOf( | ||
SpotRangeJson( | ||
20, | ||
1, | ||
5 | ||
) | ||
HappeningJson( | ||
"fest-med-tilde", | ||
"Fest med Tilde!", | ||
"2021-05-06T16:46+01:00", | ||
"2030-06-02T14:20+01:00", | ||
spotRanges = | ||
listOf( | ||
SpotRangeJson( | ||
20, | ||
1, | ||
5, | ||
), | ||
), | ||
HAPPENING_TYPE.EVENT, | ||
validStudentGroups[2], | ||
), | ||
HAPPENING_TYPE.EVENT, | ||
validStudentGroups[2] | ||
) | ||
) | ||
|
||
val adminTestUser = UserJson( | ||
"[email protected]", | ||
"Test McTest", | ||
memberships = listOf("webkom"), | ||
strikes = 0, | ||
createdAt = DateTime.now().toString(), | ||
modifiedAt = DateTime.now().toString() | ||
) | ||
val adminTestUser = | ||
UserJson( | ||
"[email protected]", | ||
"Test McTest", | ||
memberships = listOf("webkom"), | ||
strikes = 0, | ||
createdAt = DateTime.now().toString(), | ||
modifiedAt = DateTime.now().toString(), | ||
) | ||
|
||
try { | ||
transaction { | ||
|
Oops, something went wrong.
7dd8ed2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
echo-web – ./
echo-web-git-master-echo-webkom.vercel.app
echo-uib-no.vercel.app
echo-web-echo-webkom.vercel.app
echo.uib.no