laravel-nomad icon indicating copy to clipboard operation
laravel-nomad copied to clipboard

Problem when changing columns

Open joaobarbosa opened this issue 8 years ago • 2 comments

Hi @patrickcarlohickman, I've been having some problems when changing columns.

What's going on: I've got a table with a string-type field, but, I'd like to use "citext" from Postgres. Here is my migration:

// ...
    public function up()
    {
        Schema::table('posts', function (Blueprint $table) {
            $table->passthru('citext', 'title')->unique()->change();
        });
    }
// ...

When I try to run the migration, it raises a Doctrine\DBAL\DBALException, pointing out to passthru field:

Unknown column type "passthru" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information. 

I don't have enough time to go deeper on it right now, but I will update this issue with any additional info I'm able to find out later. Anyway, if it is simple as adding it to Doctrine known-types, I think it should be pointed out in the docs. :)

Thanks!

joaobarbosa avatar May 29 '16 01:05 joaobarbosa

Just commenting to note that I got this error as well. Pretty much the same kind of migration.

BlackDeer avatar Mar 23 '20 15:03 BlackDeer

Same Here, any solution yet ?

theejhay avatar Apr 01 '22 14:04 theejhay