diff --git a/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt index 343093b0..edb218ed 100644 --- a/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt +++ b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedContentRepo.kt @@ -22,10 +22,11 @@ private val Content.type private class ContentRepoDatabaseTable( private val database: Database, + tableName: String = "", private val textHolder: ContentHolderRepo, private val binaryHolder: ContentHolderRepo, private val specialHolder: ContentHolderRepo -) : Table("ContentRepo"), ContentRepo, ContentHolderRepo { +) : Table(tableName), ContentRepo, ContentHolderRepo { internal val idColumn = text("_id") internal val typeColumn = text("type") @@ -147,7 +148,8 @@ private class ContentRepoDatabaseTable( class ExposedContentRepo ( database: Database, + tableName: String = "", textHolder: ContentHolderRepo = TextContentHolderRepo(database), binaryHolder: ContentHolderRepo = BinaryContentHolderRepo(database), specialHolder: ContentHolderRepo = SpecialContentHolderRepo(database) -) : ContentRepo by ContentRepoDatabaseTable(database, textHolder, binaryHolder, specialHolder) +) : ContentRepo by ContentRepoDatabaseTable(database, tableName, textHolder, binaryHolder, specialHolder) diff --git a/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt index aa7fc25c..fdabe1d7 100644 --- a/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt +++ b/core/exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsRepo.kt @@ -71,8 +71,9 @@ private class PostsRepoContentRelations( private val dateTimeFormat = DateFormat("EEE, dd MMM yyyy HH:mm:ss z") private class PostsRepoDatabaseTable( - private val database: Database -) : PostsRepo, Table() { + private val database: Database, + tableName: String = "" +) : PostsRepo, Table(tableName) { private val contentsTable = PostsRepoContentRelations(database) private val idColumn = text("postId") @@ -210,5 +211,6 @@ private class PostsRepoDatabaseTable( } class ExposedPostsRepo ( - database: Database -) : PostsRepo by PostsRepoDatabaseTable(database) + database: Database, + tableName: String = "" +) : PostsRepo by PostsRepoDatabaseTable(database, tableName)