Plugin fieldtype settings for ColumnType::LongText being inserted as varchar(255) I’m working on a plugin that includes a custom fieldtype. Using Craft 2.6.2911, the fieldtype’s defineSettings looks like this:

public function defineSettings ( ) {
    return [
        'json_data'  =&gt;  [
            AttributeType::String,
            'column'  =&gt;  ColumnType::LongText
        ]
    ];
}


When I add this field to a tab group, the new column is added to the craft_content table as a varchar(255), not a text-type column.  Is there an additional definition I need somewhere?

I did not see a relevant note in the changelog for builds of Craft between 2.6.2911 and 2.6.2944.

When reviewing my database schema, I'm seeing the following: 

| field_jsonSync             | varchar(255)           | YES  |     | NULL    |                |
The Field Types defineSettings method defines the settings that get handled when you create the field. Those field settings get stored as json in the craft_fields.settings column when the field is created.

The BaseFieldType class has another method you can add to your class called defineContentAttribute. In your case, getting the column to be the data type you want would look like:

public function defineContentAttribute()
{
    return [
        AttributeType::String,
        'column'  =&gt;  ColumnType::LongText
    ];
}


The PlainTextFieldType and RichTextFieldType classes have similar use cases which modify the default defineContentAttribute value if you want to take a look at a few more examples.