-
-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
type:bugBugBug
Description
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:
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type:bugBugBug
Type
Projects
Status
Released