Created
May 21, 2017 05:54
-
-
Save candostdagdeviren/3fe9754017c4e12b217313524f566291 to your computer and use it in GitHub Desktop.
Vapor 1 -> 2 Migration
This file contains 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
final class User: Model { | |
let storage = Storage() | |
var name: String | |
var score: Int | |
init(row: Row) throws { | |
name = try row.get("name") | |
score = try row.get("score") | |
} | |
func makeRow() throws -> Row { | |
var row = Row() | |
try row.set("name", name) | |
try row.set("score", score) | |
return row | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment