I tried this following query to add values to the enum field in laravel:
Schema::table('files', function (Blueprint $table) {
$table->enum('file_type',['p','sq','pr','ao'])
->comment('p => property, sq => square offset or FloorPlan, pr => pricing review, ao => availability_overlay')
->change();
});
With above code: it throws erors as:
Unknown column type "enum" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType()
So, on looking I found I need to use raw query, and here it is:
Schema::table('files', function (Blueprint $table) {
\DB::statement("
ALTER TABLE `files` CHANGE COLUMN `file_type` `file_type` ENUM('p','sq','pr','ao') COMMENT 'p => property, sq => square offset or Floorplan, pr => pricing review, ao => availability_overlay' NOT NULL
");
});
this one is working fine, but it is not working on test environment (sqlite). How, could I add the equivalent query of above for sqlite environment.