impl Account Table

This commit is contained in:
Andrew Glaze
2025-05-15 22:14:00 -04:00
parent 04c5660f7d
commit cada630298
14 changed files with 268 additions and 211 deletions

View File

@@ -0,0 +1,21 @@
import Fluent
struct CreateAccount: AsyncMigration {
func prepare(on database: any Database) async throws {
try await database.schema("accounts")
.field("id", .int, .identifier(auto: true))
.field("app_id", .string, .required)
.field("first_login_time", .date, .required)
.field("idp_alias", .string, .required)
.field("idp_code", .string, .required)
.field("idp_id", .string, .required)
.field("reg_time", .date, .required)
.field("last_login_time", .date, .required)
.field("status", .string, .required)
.create()
}
func revert(on database: any Database) async throws {
try await database.schema("accounts").delete()
}
}

View File

@@ -1,14 +0,0 @@
import Fluent
struct CreateTodo: AsyncMigration {
func prepare(on database: any Database) async throws {
try await database.schema("todos")
.id()
.field("title", .string, .required)
.create()
}
func revert(on database: any Database) async throws {
try await database.schema("todos").delete()
}
}