I would like to have a table with a string column as a primary key without having to use raw SQL syntax.
Here's my fluent "preparation":
static func prepare(_ database: Database) throws {
try database.create("roles") { roles in
roles.id("name")
roles.string("readable_name")
}
}
According to both my tests and the docs, resulting query will be similar to:
CREATE TABLE `roles` (`name` INTEGER PRIMARY KEY NOT NULL, `readable_name` TEXT NOT NULL)
I could not, so far, find a way to have a string (TEXT, VARCHAR, ...) as a primary key without raw SQL syntax and i would like to know whether it's possible to do it or not using the fluent query builder which comes with vapor.