Closed Eugentis closed 5 months ago
We have PostgreSQL table state like:
create table logs ( ..., target varchar(7) constraint logs_target_enum_62e2522d7df9c check ((target)::text = 'catalog'::text) );
but cycle:migrate can't detect that field already have enum type and each next migration tries to fix it in next way:
cycle:migrate
class OrmDefault561cd35f5d5487d642a5bd8b65997299 extends Migration { public function up(): void { $this->table('logs') ->alterColumn('target', 'enum', [ 'nullable' => true, 'default' => null, 'values' => [ 'catalog' ] ]) ->update(); } public function down(): void { $this->table('logs') ->alterColumn('target', 'string', [ 'nullable' => true, 'default' => null, 'size' => 7 ]) ->update(); } }
As I can see migrator can't understand that field already have enum functionality based on constraints
One more comment - it is actual only for cases when enum contains only one value
We have PostgreSQL table state like:
but
cycle:migrate
can't detect that field already have enum type and each next migration tries to fix it in next way:As I can see migrator can't understand that field already have enum functionality based on constraints