Created
April 12, 2019 15:24
-
-
Save standinga/d4d918d88ecc12300a52114b04857e27 to your computer and use it in GitHub Desktop.
Vapor template update Todo.swift to use MySQL instead of SQLite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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