{
  "databaseChangeLog": [
    {
      "changeSet": {
        "id": "Add buildings table",
        "author": "anibus",
        "changes": [
          {
            "createTable": {
              "tableName": "building_addons",
              "columns": [
                {
                  "column": {
                    "name": "id",
                    "type": "int",
                    "autoIncrement": true,
                    "constraints": {
                      "primaryKey": true,
                      "nullable": false
                    }
                  }
                },
                {
                  "column": {
                    "name": "filename",
                    "type": "varchar(255)",
                    "constraints": {
                      "nullable": false
                    }
                  }
                },{
                  "column": {
                    "name": "name",
                    "type": "varchar(255)"
                  }
                },{
                  "column": {
                    "name": "description",
                    "type": "varchar(5000)"
                  }
                },
                {
                  "column": {
                    "name": "addon_cost_requisition",
                    "type": "number"
                  }
                },{
                  "column": {
                    "name": "addon_cost_power",
                    "type": "number"
                  }
                },{
                  "column": {
                    "name": "addon_cost_population",
                    "type": "number"
                  }
                },{
                  "column": {
                    "name": "addon_cost_faith",
                    "type": "number"
                  }
                },{
                  "column": {
                    "name": "addon_cost_souls",
                    "type": "number"
                  }
                },{
                  "column": {
                    "name": "addon_cost_time",
                    "type": "int"
                  }
                },{
                  "column": {
                    "name": "icon",
                    "type": "varchar(128)"
                  }
                },
                {
                  "column": {
                    "name": "building_id",
                    "type": "int",
                    "constraints": {
                      "nullable": false
                    }
                  }
                }
              ]
            }
          },
          {
            "addForeignKeyConstraint":
            {
              "baseColumnNames":  "building_id",
              "baseTableName":  "building_addons",
              "constraintName":  "fk_building_addons_buildings",
              "referencedColumnNames":  "id",
              "referencedTableName":  "buildings",
              "onDelete": "CASCADE"
            }
          }
        ]
      }
    }
  ]
}
