Skip to content

Instantly share code, notes, and snippets.

@standinga
Created April 12, 2019 15:24
Show Gist options
  • Select an option

  • Save standinga/d4d918d88ecc12300a52114b04857e27 to your computer and use it in GitHub Desktop.

Select an option

Save standinga/d4d918d88ecc12300a52114b04857e27 to your computer and use it in GitHub Desktop.
Vapor template update Todo.swift to use MySQL instead of SQLite
import FluentMySQL
import Vapor
final class Todo: Codable {
var id: Int?
var title: String
init(id: Int? = nil, title: String) {
self.id = id
self.title = title
}
}
extension Todo: MySQLModel {}
extension Todo: Content {}
extension Todo: Migration {}
extension Todo: Parameter {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment