diff --git a/src/main/kotlin/fr/postgresjson/connexion/Paginated.kt b/src/main/kotlin/fr/postgresjson/connexion/Paginated.kt index 02d23ad..f755b1e 100644 --- a/src/main/kotlin/fr/postgresjson/connexion/Paginated.kt +++ b/src/main/kotlin/fr/postgresjson/connexion/Paginated.kt @@ -14,9 +14,9 @@ data class Paginated( val totalPages: Int = (total.toDouble() / limit.toDouble()).ceil() init { - if (offset < 0) error("offset must be greather or equal than 0") - if (limit < 1) error("limit must be greather or equal than 1") - if (total < 0) error("total must be greather or equal than 0") + if (offset < 0) error("offset must be greater or equal than 0") + if (limit < 1) error("limit must be greater or equal than 1") + if (total < 0) error("total must be greater or equal than 0") } fun isLastPage(): Boolean = currentPage >= totalPages diff --git a/src/main/kotlin/fr/postgresjson/migration/Migrations.kt b/src/main/kotlin/fr/postgresjson/migration/Migrations.kt index 3f2e395..4c7d2cb 100644 --- a/src/main/kotlin/fr/postgresjson/migration/Migrations.kt +++ b/src/main/kotlin/fr/postgresjson/migration/Migrations.kt @@ -130,7 +130,7 @@ class Migrations private constructor( enum class Direction { UP, DOWN } internal class DownMigrationNotDefined(path: String, cause: FileNotFoundException? = null) : - Throwable("The file $path whas not found", cause) + Throwable("The file $path was not found", cause) fun addFunction(newDefinition: DefinitionFunction, callback: (Function) -> Unit = {}): Migrations { val currentFunction = functions[newDefinition.name] @@ -174,10 +174,10 @@ class Migrations private constructor( private fun initDB() { if (!initialized) { - this::class.java.classLoader.getResource("sql/migration/createHistoryShema.sql")!!.readText().let { + this::class.java.classLoader.getResource("sql/migration/createHistorySchema.sql")!!.readText().let { connection.sendQuery(it) } - this::class.java.classLoader.getResource("sql/migration/createFunctionShema.sql")!!.readText().let { + this::class.java.classLoader.getResource("sql/migration/createFunctionSchema.sql")!!.readText().let { connection.sendQuery(it) } initialized = true diff --git a/src/main/resources/sql/migration/createFunctionShema.sql b/src/main/resources/sql/migration/createFunctionSchema.sql similarity index 100% rename from src/main/resources/sql/migration/createFunctionShema.sql rename to src/main/resources/sql/migration/createFunctionSchema.sql diff --git a/src/main/resources/sql/migration/createHistoryShema.sql b/src/main/resources/sql/migration/createHistorySchema.sql similarity index 100% rename from src/main/resources/sql/migration/createHistoryShema.sql rename to src/main/resources/sql/migration/createHistorySchema.sql