- WIP on Migration of MsSQL
This commit is contained in:
1 parent
c54de30069
commit
fb4985160a
17 files changed
+252
-175
No files matched your search
@@ -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,
|
||||
]));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user