{
  "databaseChangeLog": [
    {
      "changeSet": {
        "id": "Add ability_affected_buildings table",
        "author": "ai_assistant",
        "changes": [
          {
            "createTable": {
              "tableName": "ability_affected_buildings",
              "columns": [
                {
                  "column": {
                    "name": "ability_id",
                    "type": "int",
                    "constraints": { "nullable": false }
                  }
                },
                {
                  "column": {
                    "name": "building_id",
                    "type": "int",
                    "constraints": { "nullable": false }
                  }
                }
              ]
            }
          },
          {
            "addUniqueConstraint": {
              "columnNames": "ability_id, building_id",
              "constraintName": "uc_ability_affected_buildings",
              "tableName": "ability_affected_buildings"
            }
          },
          {
            "addForeignKeyConstraint": {
              "baseColumnNames": "ability_id",
              "baseTableName": "ability_affected_buildings",
              "constraintName": "fk_ability_aff_build_ability",
              "referencedColumnNames": "id",
              "referencedTableName": "abilities",
              "onDelete": "CASCADE"
            }
          },
          {
            "addForeignKeyConstraint": {
              "baseColumnNames": "building_id",
              "baseTableName": "ability_affected_buildings",
              "constraintName": "fk_ability_aff_build_building",
              "referencedColumnNames": "id",
              "referencedTableName": "buildings",
              "onDelete": "CASCADE"
            }
          }
        ]
      }
    }
  ]
}
