shiftonelabs / laravel-nomad

Adds some extra functionality to Laravel migrations.
MIT License
21 stars 1 forks source link

Problem when changing columns #3

Open joaobarbosa opened 8 years ago

joaobarbosa commented 8 years ago

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!

BlackDeer commented 4 years ago

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

theejhay commented 2 years ago

Same Here, any solution yet ?