skipAssertion( fn (Schema $schema) => $schema->getTable($this->getPrefixedTableName())->hasColumn('version'), "Table {$this->getPrefixedTableName()} already has 'version' column" ); } public function up(Schema $schema): void { $table = $schema->getTable($this->getPrefixedTableName()); $table->addColumn('version', Types::INTEGER) ->setUnsigned(true) ->setDefault(OptimisticLockInterface::INITIAL_VERSION); } public function down(Schema $schema): void { $table = $schema->getTable($this->getPrefixedTableName()); $table->dropColumn('version'); } }