samedi 8 août 2015

Expected declaration during table creation

When attempting to execute the following code:

db.create(table: PCharacters) { t in
    t.column(id, primaryKey: .Autoincrement)
    t.column(charName, unique: true)
    t.column(currentHP)
    t.column(maxHP)
    t.column(currentMP)
    t.column(maxMP)
    t.column(currentExp)
    t.column(nextExp)
    t.column(charWeaponID)
}

I get an "Expected Declaration" error on the first line. Now, I've declared "db" and "PCharacters" above, which leads me to believe that what it doesn't like is "t". If that is the case, what is "t" supposed to be, and where and how do I declare it above this block of code? (And if it's not, what is returning the Expected Declaration error?)

Aucun commentaire:

Enregistrer un commentaire