Skip to content

Commit f2954ee

Browse files
committed
DDL failure recovery
1 parent 927545f commit f2954ee

3 files changed

Lines changed: 624 additions & 190 deletions

File tree

src/Database/Adapter.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,25 @@ abstract public function getInternalIndexesKeys(): array;
13651365
*/
13661366
abstract public function getSchemaAttributes(string $collection): array;
13671367

1368+
/**
1369+
* Get the expected column type for a given attribute type.
1370+
*
1371+
* Returns the database-native column type string (e.g. "VARCHAR(255)", "BIGINT")
1372+
* that would be used when creating a column for the given attribute parameters.
1373+
* Returns an empty string if the adapter does not support this operation.
1374+
*
1375+
* @param string $type
1376+
* @param int $size
1377+
* @param bool $signed
1378+
* @param bool $array
1379+
* @param bool $required
1380+
* @return string
1381+
*/
1382+
public function getColumnType(string $type, int $size, bool $signed = true, bool $array = false, bool $required = false): string
1383+
{
1384+
return '';
1385+
}
1386+
13681387
/**
13691388
* Get the query to check for tenant when in shared tables mode
13701389
*

src/Database/Adapter/SQL.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,11 @@ abstract protected function getSQLType(
18291829
bool $required = false
18301830
): string;
18311831

1832+
public function getColumnType(string $type, int $size, bool $signed = true, bool $array = false, bool $required = false): string
1833+
{
1834+
return $this->getSQLType($type, $size, $signed, $array, $required);
1835+
}
1836+
18321837
/**
18331838
* Get SQL Index Type
18341839
*

0 commit comments

Comments
 (0)