use sequence per tenant

This commit is contained in:
gowthaman
2024-05-23 13:40:28 +05:30
parent 0c9313b77c
commit d51c8c7547
2 changed files with 5 additions and 15 deletions

View File

@@ -206,7 +206,8 @@ object Session {
.findOne() ?: throw DataNotFoundException
}
private fun seqName(entity: String) = "sequence_$entity"
private fun seqName(entity: String) = "sequence_${entity}_${currentTenant()}"
fun creatSeq(entity: String): Int {
return database.sqlUpdate("CREATE SEQUENCE IF NOT EXISTS ${seqName(entity)} START 1;").execute()
}