We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func resetData(req: Request) throws -> Future<Response> { return Post.query(on: req).delete().map(to: Response.self) { return Response(http: HTTPResponse(status: .ok), using: req) } }
import Foundation import FluentMySQL import Vapor struct Post: Content, MySQLModel, Migration { var id: Int? var title: String var strap: String var content: String var category: Int var slug: String var date: Date static func prepare(on connection: MySQLConnection) -> Future<Void> { return MySQLDatabase.create(self, on: connection) { builder in try builder.field(type: .int64(), for: \.id, isOptional: false, isIdentifier: true) try builder.field(for: \.title) try builder.field(for: \.strap) try builder.field(type: .text(), for: \.content) try builder.field(for: \.category) try builder.field(for: \.slug) try builder.field(for: \.date) } } }
The text was updated successfully, but these errors were encountered:
tanner0101
No branches or pull requests
The text was updated successfully, but these errors were encountered: