I am trying to store text of approximately 600-1k characters. Using a field definition, such as:
@Field(key: "role")
var role: String?
Creates the usual VARCHAR(255) column in the MySQL data table. This results in the INSERT crashing because the data is too long.
I have tried putting an explicit definition in the Migration to use a TEXT column type as follows:
.field("role", .sql(.text))
However, in MySQLDialect.swift, at line 46, this defines a field specified as .text as still being VARCHAR(255). So, I get the same result.
If I manually change the column to TEXT using MySQL client between the migration to create the table and the one to insert the initial dataset, my application works as intended.
Shouldn't .text create a TEXT column instead of the same as .string?
I am trying to store text of approximately 600-1k characters. Using a field definition, such as:
Creates the usual
VARCHAR(255)column in the MySQL data table. This results in the INSERT crashing because the data is too long.I have tried putting an explicit definition in the
Migrationto use a TEXT column type as follows:.field("role", .sql(.text))However, in MySQLDialect.swift, at line 46, this defines a field specified as
.textas still beingVARCHAR(255). So, I get the same result.If I manually change the column to TEXT using MySQL client between the migration to create the table and the one to insert the initial dataset, my application works as intended.
Shouldn't
.textcreate aTEXTcolumn instead of the same as.string?