Skip to content

Commit

Permalink
Update Job Migration to use a json field rather than a bytea
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanoroy committed Aug 8, 2022
1 parent 25075d7 commit 53462d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/QueuesFluentDriver/JobModelMigrate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import SQLKit

public struct JobModelMigrate: Migration {
public init() {}

public init(schema: String) {
JobModel.schema = schema
}

public func prepare(on database: Database) -> EventLoopFuture<Void> {
return database.schema(JobModel.schema)
.id()
.field(FieldKey.jobId, .string, .required)
.field(FieldKey.queue, .string, .required)
.field(FieldKey.data, .data, .required)
.field(FieldKey.data, .json, .required)
.field(FieldKey.state, .string, .required)
.field(FieldKey.createdAt, .datetime)
.field(FieldKey.updatedAt, .datetime)
Expand Down Expand Up @@ -42,7 +42,7 @@ public struct JobModelMigrate: Migration {
}
}
}

public func revert(on database: Database) -> EventLoopFuture<Void> {
return database.schema(JobModel.schema).delete()
}
Expand Down

0 comments on commit 53462d9

Please sign in to comment.