File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,14 +64,6 @@ let package = Package(
6464 . plugin(
6565 name: " OtterPlugin " ,
6666 capability: . buildTool( ) ,
67- // capability: .command(
68- // intent: .custom(
69- // verb: "otter", description: "Generates the database queries"
70- // ),
71- // permissions: [
72- // .writeToPackageDirectory(reason: "Writes the queries out to a swift file."),
73- // ]
74- // ),
7567 dependencies: [ " OtterCLI " ]
7668 ) ,
7769
Original file line number Diff line number Diff line change @@ -51,6 +51,31 @@ struct MigrationRunnerTests: ~Copyable {
5151 #expect( value == " first, second, third " )
5252 }
5353
54+ @Test func migrationsAreRunIncrementally( ) async throws {
55+ var migrations = [ " CREATE TABLE foo (value TEXT) " ]
56+
57+ try MigrationRunner . execute (
58+ migrations: migrations,
59+ connection: connection
60+ )
61+
62+ migrations. append ( " CREATE TABLE bar (value TEXT) " )
63+
64+ try MigrationRunner . execute (
65+ migrations: migrations,
66+ connection: connection
67+ )
68+
69+ // Run again with no new migrations
70+ try MigrationRunner . execute (
71+ migrations: migrations,
72+ connection: connection
73+ )
74+
75+ let _: String ? = try query ( " SELECT * FROM foo " ) { try $0. fetchOne ( ) }
76+ let _: String ? = try query ( " SELECT * FROM bar " ) { try $0. fetchOne ( ) }
77+ }
78+
5479 @Test func failedMigrationRollsbackChanges( ) async throws {
5580 #expect( throws: OtterError . self) {
5681 try MigrationRunner . execute (
You can’t perform that action at this time.
0 commit comments