Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Commit c92d106

Browse files
committed
upgrading to the new sugar extensions for foreign and indexes
1 parent 21afc74 commit c92d106

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Sources/AdminPanel/Models/BackendUsers/BackendUser.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ public final class BackendUser: Auth.User, Model {
113113
table.timestamps()
114114
}
115115

116-
try database.driver.raw(database.foreign(parentTable: "backend_user_roles", parentPrimaryKey: "slug", childTable: "backend_users", childForeignKey: "role"))
117-
118-
try database.driver.raw(database.index(table: "backend_users", column: "email"))
116+
try database.foreign(parentTable: "backend_user_roles", parentPrimaryKey: "slug", childTable: "backend_users", childForeignKey: "role")
117+
try database.index(table: "backend_users", column: "email")
119118
}
120119

121120
public static func revert(_ database: Database) throws {

Sources/AdminPanel/Models/BackendUsers/BackendUserResetPasswordTokens/BackendUserResetPasswordTokens.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public final class BackendUserResetPasswordTokens: Model {
7171
table.timestamps()
7272
}
7373

74-
try database.driver.raw(database.index(table: "backend_reset_password_tokens", column: "email"))
75-
try database.driver.raw(database.index(table: "backend_reset_password_tokens", column: "token"))
74+
try database.index(table: "backend_reset_password_tokens", column: "email")
75+
try database.index(table: "backend_reset_password_tokens", column: "token")
7676
}
7777

7878
public static func revert(_ database: Database) throws {

Sources/AdminPanel/Models/BackendUsers/BackendUserRoles/BackendUserRole.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public final class BackendUserRole: Model {
6060
table.timestamps()
6161
}
6262

63-
try database.driver.raw(database.index(table: "backend_user_roles", column: "slug"))
63+
try database.index(table: "backend_user_roles", column: "slug")
6464
}
6565

6666
public static func revert(_ database: Database) throws {

0 commit comments

Comments
 (0)