I wanted to change a column type from integer
to timestamp
with new migration, but when I try to migrate it doesnt work and it shows an error
Doctrine\DBAL\Exception : Unknown column type "timestamp" 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 forgotten 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 could migrate other migrations that have timestamp datatype but without change() function, so the problem is when using change() with timestamp data type.
I tried to do whats laravel 8 documentation suggests here but still getting the same error, any advice how to solve this issue. I am using laravel 6.
migration up function:
public function up()
{
Schema::table('testassignment', function (Blueprint $table) {
$table->timestamp('duration')->nullable()->change();
});
}