Soulstorm-wiki-backend/src/main/resources/db/0.0.3/schema/buildings_researches.json
2025-08-18 12:20:24 +03:00

67 lines
1.9 KiB
JSON

{
"databaseChangeLog": [
{
"changeSet": {
"id": "Add buildings_researches table",
"author": "anibus",
"changes": [
{
"createTable": {
"tableName": "buildings_researches",
"columns": [
{
"column": {
"name": "building_id",
"type": "int",
"constraints": {
"nullable": false
}
}
},
{
"column": {
"name": "research_id",
"type": "int",
"constraints": {
"nullable": false
}
}
}
]
}
},
{
"addUniqueConstraint": {
"columnNames": "building_id, research_id",
"constraintName": "uc_buildings_researches_research_id_building_id",
"tableName": "buildings_researches"
}
},
{
"addForeignKeyConstraint":
{
"baseColumnNames": "building_id",
"baseTableName": "buildings_researches",
"constraintName": "fk_buildings_buildings_researches",
"referencedColumnNames": "id",
"referencedTableName": "buildings",
"onDelete": "CASCADE"
}
},
{
"addForeignKeyConstraint":
{
"baseColumnNames": "research_id",
"baseTableName": "buildings_researches",
"constraintName": "fk_researches_buildings_researches",
"referencedColumnNames": "id",
"referencedTableName": "researches",
"onDelete": "CASCADE"
}
}
]
}
}
]
}