gutte
gutte

Reputation: 1473

Vapor with Postgres - table is not getting prepared

I have 3 Model objects in my project.

drop.preparations.append(Club.self)
drop.preparations.append(ClubPlayers.self)
drop.preparations.append(Player.self)

for some reason, Club table is not created. this is my prepare method:

static func prepare(_ database: Database) throws {
        try database.create(Club.tableName, closure: { club in
            club.id()
            club.string(Club.nameColumn)
            club.string(Club.urlColumn)
        })

}

it's built exactly as my other models, but it's the only one that is not being created. I don't receive any warning or error. I'm using Swift 3.1.1, vapor 1.5 and vapor-toolbox 2

Upvotes: 1

Views: 923

Answers (1)

gutte
gutte

Reputation: 1473

My solution was: remove the 'Club' row from the 'fluent' table. then running vapor run prepare did work. There are also other options:

Upvotes: 2

Related Questions