This commit is contained in:
2021-11-11 14:25:26 +01:00
parent 1737a2f592
commit 25d47f7528
32 changed files with 633 additions and 121 deletions

View File

@@ -54,6 +54,11 @@ class AlterTable extends Query {
return $this;
}
public function resetAutoIncrement(): AlterTable {
$this->action = "RESET_AUTO_INCREMENT";
return $this;
}
public function getAction(): string { return $this->action; }
public function getColumn(): ?Column { return $this->column; }
public function getConstraint(): ?Constraint { return $this->constraint; }
@@ -65,6 +70,10 @@ class AlterTable extends Query {
$column = $this->getColumn();
$constraint = $this->getConstraint();
if ($action === "RESET_AUTO_INCREMENT") {
return "ALTER TABLE $tableName AUTO_INCREMENT=1";
}
$query = "ALTER TABLE $tableName $action ";
if ($column) {