if (isset($tableSchema) && !isset($tableSchema->columns[self::COLUMN_NAME])) {
$this->addColumn(self::TABLE_NAME, self::COLUMN_NAME, $this->integer()->null()->comment('ID должности администратора'));
- $this->addForeignKey(
- 'fk-admin-employee_position_id',
- self::TABLE_NAME,
- self::COLUMN_NAME,
- 'erp24.employee_position',
- 'id',
- 'SET NULL',
- 'CASCADE'
- );
+
}
}
$tableSchema = $this->db->getTableSchema(self::TABLE_NAME);
if (isset($tableSchema) && isset($tableSchema->columns[self::COLUMN_NAME])) {
- $this->dropForeignKey('fk-admin-employee_position_id', self::TABLE_NAME);
$this->dropColumn(self::TABLE_NAME, self::COLUMN_NAME);
} else {
echo "m251027_071237_add_admin_position_id_field_to_admin_table cannot be reverted.\n";