Skip to content

Commit

Permalink
Fix TableQueryBuilderTest
Browse files Browse the repository at this point in the history
  • Loading branch information
takapi327 committed Oct 20, 2023
1 parent ae56c6b commit a559afc
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions core/src/test/scala/ldbc/core/builder/TableQueryBuilderTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -322,26 +322,6 @@ object TableQueryBuilderTest extends Specification:
|""".stripMargin
}

"IllegalArgumentException is raised if the type of the column set in FOREIGN KEY does not match." in {
case class Test(id: Long, subId: Long)
case class SubTest(id: Long, test: String)

val subTable: Table[SubTest] = Table[SubTest]("sub_test")(
column("id", BIGINT(64), AUTO_INCREMENT, PRIMARY_KEY),
column("test", VARCHAR(64))
)

val table: Table[Test] = Table[Test]("test")(
column("id", BIGINT(64), AUTO_INCREMENT),
column("sub_id", BIGINT(64))
)
.keySet(table => PRIMARY_KEY(table.id))
.keySet(table => INDEX_KEY(table.subId))
.keySet(table => CONSTRAINT("fk_id", FOREIGN_KEY(table.subId, REFERENCE(subTable, subTable.test))))

TableQueryBuilder(table) must throwAn[IllegalArgumentException]
}

"If a column that is not a PRIMARY KEY is set as a FOREIGN KEY, an IllegalArgumentException will be thrown." in {
case class Test(id: Long, subId: Long)
case class SubTest(id: Long, test: Long)
Expand Down

0 comments on commit a559afc

Please sign in to comment.