Skip to content

Commit

Permalink
feat: EXPOSED-77 Support entity class for table with composite primar…
Browse files Browse the repository at this point in the history
…y key

- Remove changes to reference logic.
- Small change to unit test.
- Rebase from main.
  • Loading branch information
bog-walk committed Feb 9, 2024
1 parent 8f1c001 commit a0630fd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import kotlin.test.assertIs
import kotlin.test.assertNotNull
import kotlin.test.assertTrue

// SQLite excluded from all tests as it only allows auto-increment on single column PKs.
// SQL Server is sometimes excluded because it doesn't allow inserting explicit values for identity columns.
class CompositeIdTableEntityTest : DatabaseTestsBase() {
object Publishers : CompositeIdTable("publishers") {
val pubId = uuid("pub_id").autoGenerate().compositeEntityId()
Expand All @@ -32,11 +34,9 @@ class CompositeIdTableEntityTest : DatabaseTestsBase() {
var name by Publishers.name
}

// SQLite excluded as only allows auto-increment on single column PKs
// SQL Server doesn't allow inserting explicit value for identity columns
@Test
fun testCreateAndDropCompositeIdTable() {
withDb(excludeSettings = listOf(TestDB.SQLITE, TestDB.SQLSERVER)) {
withDb(excludeSettings = listOf(TestDB.SQLITE)) {
try {
SchemaUtils.create(Publishers)
assertTrue(Publishers.exists())
Expand Down

0 comments on commit a0630fd

Please sign in to comment.