statamic-rad-pack / runway

Eloquently manage your database models in Statamic.
https://statamic.com/addons/rad-pack/runway
MIT License
112 stars 47 forks source link

How to fix "Column could not be matched with a fieldtype" on generate-blueprints from migration? #523

Closed duncanmcclean closed 3 months ago

duncanmcclean commented 3 months ago

Discussed in https://github.com/statamic-rad-pack/runway/discussions/521

Originally posted by **IVoyt** June 12, 2024 ### Description When I try to generate a blueprint from a migration with `php please runway:generate-blueprints ` I permanently get error from the title. I have a migration with fields integer (int11) and string (varchar255). Which field types I have to specify to successfully generate blueprint from the migration? ### Environment Environment Application Name: TEST CMS Laravel Version: 11.8.0 PHP Version: 8.2.13 Composer Version: 2.2.7 Environment: local Debug Mode: ENABLED URL: test.cms.loc Maintenance Mode: OFF Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED Drivers Broadcasting: log Cache: statamic Database: mysql Logs: stack / single Mail: log Queue: sync Session: file Statamic Addons: 6 Sites: 2 (TEST CMS 1, TEST CMS 2) Stache Watcher: Enabled Static Caching: Disabled Version: 5.7.2 PRO Statamic Addons eminos/statamic-tabs: 1.2.0 mitydigital/statamic-tinymce-cloud: 3.0.0 statamic-rad-pack/runway: 7.3.1 statamic/collaboration: 1.0.0 statamic/eloquent-driver: 4.0.0 statamic/ssg: 3.0.1 Statamic Eloquent Driver Asset Containers: eloquent Assets: eloquent Blueprints: file Collection Trees: eloquent Collections: eloquent Entries: eloquent Forms: eloquent Global Sets: eloquent Global Variables: eloquent Navigation Trees: eloquent Navigations: eloquent Revisions: file Taxonomies: eloquent Terms: eloquent
ryanmitchell commented 3 months ago

Interesting! What version of MySQL are you running? @IVoyt Can you run \Illuminate\Support\Facades\Schema::getColumns('your_table_name'); and paste the results here?

IVoyt commented 3 months ago

\Illuminate\Support\Facades\Schema::getColumns('your_table_name');

here is the output

array:7 [
  0 => array:9 [
    "name" => "id"
    "type_name" => "bigint"
    "type" => "bigint(20) unsigned"
    "collation" => null
    "nullable" => false
    "default" => null
    "auto_increment" => true
    "comment" => null
    "generation" => null
  ]
  1 => array:9 [
    "name" => "name"
    "type_name" => "json"
    "type" => "json"
    "collation" => null
    "nullable" => false
    "default" => null
    "auto_increment" => false
    "comment" => null
    "generation" => null
  ]
  2 => array:9 [
    "name" => "logo"
    "type_name" => "json"
    "type" => "json"
    "collation" => null
    "nullable" => false
    "default" => null
    "auto_increment" => false
    "comment" => null
    "generation" => null
  ]
  3 => array:9 [
    "name" => "url"
    "type_name" => "varchar"
    "type" => "varchar(255)"
    "collation" => "utf8mb4_unicode_ci"
    "nullable" => false
    "default" => null
    "auto_increment" => false
    "comment" => null
    "generation" => null
  ]
  4 => array:9 [
    "name" => "status"
    "type_name" => "int"
    "type" => "int(11)"
    "collation" => null
    "nullable" => false
    "default" => null
    "auto_increment" => false
    "comment" => null
    "generation" => null
  ]
  5 => array:9 [
    "name" => "created_at"
    "type_name" => "timestamp"
    "type" => "timestamp"
    "collation" => null
    "nullable" => true
    "default" => null
    "auto_increment" => false
    "comment" => null
    "generation" => null
  ]
  6 => array:9 [
    "name" => "updated_at"
    "type_name" => "timestamp"
    "type" => "timestamp"
    "collation" => null
    "nullable" => true
    "default" => null
    "auto_increment" => false
    "comment" => null
    "generation" => null
  ]
]
github-actions[bot] commented 3 months ago

Released as part of v7.4.0.