Tailor field type datatable - Column not found: 1054 Unknown column

Hi, I am new to OctoberCMS and am trying to add a datatable field to a tailor form. The tab and table appears, but when saving it says that the column for the field does not exist.

Definition in yaml:

    listing:
        tab: Listing
        label: Liste
        commentAbove: 'Tabellarische Auflistung'
        type: datatable
        adding: true
        deleting: true
        columns: 
            date:
                type: string
                title: Datum / Jahr
            text:
                type: string
                title: Eintrag
        recordsPerPage: false
        searching: false

Error when saving:

"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'listing' in 'field list' (SQL: update `xc_c2e9c4b18a314e7db0c3655afc5c61a4c` set `published_at_month` = 01, `listing` = [[]], `xc_c2e9c4b18a314e7db0c3655afc5c61a4c`.`updated_at` = 2023-01-10 17:17:10 where `id` = 5)" on line 760 of /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php

Do I need to create the column somewhere? Thank you!

Hi @momonu

It looks like your database might not be migrated, you can migrate tailor specifically with the following command:

php artisan tailor:migrate

I hope this helps!

Hi @daft , thanks a lot. I tried executing that command, but I get a SQLSTATE[HY000] [2002] Connection refused error. I am running the docker image. Do you know what I have to do?

Thank you!

You can also try running it in PHP

\Artisan::call('tailor:migrate');

Thank you. I figured it out at some point. There was a misconfiguration in the yaml files.

Not all references were correct. I fixed it and hit save & migrate on all yaml files. It then worked.

1 Like