Add booking travel cities and member relation
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s

This commit is contained in:
androidlover5842
2026-01-29 13:55:17 +05:30
parent 5fe19cf54c
commit 4c0264cdbe
5 changed files with 79 additions and 0 deletions

View File

@@ -23,5 +23,47 @@ class BookingSchemaFix(
logger.info("Adding booking.expected_guest_count column")
jdbcTemplate.execute("alter table booking add column expected_guest_count integer")
}
val hasFromCity = jdbcTemplate.queryForObject(
"""
select count(*)
from information_schema.columns
where table_name = 'booking'
and column_name = 'from_city'
""".trimIndent(),
Int::class.java
) ?: 0
if (hasFromCity == 0) {
logger.info("Adding booking.from_city column")
jdbcTemplate.execute("alter table booking add column from_city varchar")
}
val hasToCity = jdbcTemplate.queryForObject(
"""
select count(*)
from information_schema.columns
where table_name = 'booking'
and column_name = 'to_city'
""".trimIndent(),
Int::class.java
) ?: 0
if (hasToCity == 0) {
logger.info("Adding booking.to_city column")
jdbcTemplate.execute("alter table booking add column to_city varchar")
}
val hasMemberRelation = jdbcTemplate.queryForObject(
"""
select count(*)
from information_schema.columns
where table_name = 'booking'
and column_name = 'member_relation'
""".trimIndent(),
Int::class.java
) ?: 0
if (hasMemberRelation == 0) {
logger.info("Adding booking.member_relation column")
jdbcTemplate.execute("alter table booking add column member_relation varchar")
}
}
}