Skip to content

Commit

Permalink
Allow defining tables with quoted names (#1562) / Fix test #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapac committed Oct 3, 2022
1 parent d2c8df9 commit b8ac893
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ class CreateTableTests : DatabaseTestsBase() {

@Test
fun createTableWithSingleQuotes() {
val parent = object : LongIdTable("'Parent'") {}
val child = object : LongIdTable("'Child'") {
val parent = object : LongIdTable("'Parent2'") {}
val child = object : LongIdTable("'Child2'") {
val parentId = reference(
name = "parent_id",
foreign = parent,
Expand All @@ -261,7 +261,7 @@ class CreateTableTests : DatabaseTestsBase() {
val expected = listOf(
"CREATE TABLE " + addIfNotExistsIfSupported() + "${this.identity(child)} (" +
"${child.columns.joinToString { it.descriptionDdl(false) }}," +
" CONSTRAINT ${"fk_Child_parent_id__id".inProperCase()}" +
" CONSTRAINT ${"fk_Child2_parent_id__id".inProperCase()}" +
" FOREIGN KEY (${this.identity(child.parentId)})" +
" REFERENCES ${this.identity(parent)}(${this.identity(parent.id)})" +
")"
Expand Down

0 comments on commit b8ac893

Please sign in to comment.