- WIP on Migration of MsSQL

This commit is contained in:
Dave Mc Nicoll committed 2025-05-21 18:46:34 +00:00
1 parent c54de30069
commit fb4985160a
17 files changed
+252 -175

No files matched your search

-10
View File
@@ -32,21 +32,11 @@ trait SqlMigrationTrait
public function generateAlterColumn(FieldDefinition $definition, array $field) : string|\Stringable
{
if ($field['action'] === 'add') {
if (! empty($field['previous'])) {
$position = sprintf('AFTER %s', $this->escapeIdentifier($field['previous']->field, AdapterInterface::IDENTIFIER_FIELD));
}
else {
$position = "FIRST";
}
}
return implode(" ", array_filter([
strtoupper($field['action']),
$this->escapeIdentifier($definition->getSqlName(), AdapterInterface::IDENTIFIER_FIELD),
$definition->getSqlType(),
$definition->getSqlParams(),
$position ?? null,
]));
}