Skip to content

.text creates a VARCHAR(255) column #290

Description

@bottlehall

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions