Skip to content

Commit cb48c3d

Browse files
committed
Cleaned up name
1 parent 3acb47b commit cb48c3d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Sources/PureSQL/Database.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ public extension Database {
6969
}
7070

7171
/// Runs the migrations up to and including the `maxMigration`.
72+
///
73+
/// The `maxMigration` number is not equal to the filename, but
74+
/// rather the zero based index.
7275
func migrate(upTo maxMigration: Int? = nil) async throws {
7376
try await connection.withConnection(isWrite: true) { conn in
7477
try MigrationRunner.execute(

Sources/PureSQL/Migration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enum MigrationRunner {
1414
connection: RawConnection,
1515
upTo maxMigration: Int? = nil
1616
) throws {
17-
let previouslyRunMigrations = try runMigrations(connection: connection)
17+
let previouslyRunMigrations = try getRanMigrations(connection: connection)
1818
let lastMigration = previouslyRunMigrations.last ?? Int.min
1919

2020
let pendingMigrations = migrations.enumerated()
@@ -56,7 +56,7 @@ enum MigrationRunner {
5656
}
5757

5858
/// Creates the migrations table and gets the last migration that ran.
59-
private static func runMigrations(connection: RawConnection) throws -> [Int] {
59+
private static func getRanMigrations(connection: RawConnection) throws -> [Int] {
6060
let tx = try Transaction(connection: connection, kind: .write)
6161

6262
// Create the migration table if need be.

0 commit comments

Comments
 (0)