Giter VIP home page Giter VIP logo

Comments (3)

gcscaglia avatar gcscaglia commented on May 16, 2024

Just in case downloading and running the example is cumbersome or otherwise inviable, here is the offending model:

object Boards : IntIdTable(name = "board") {
    val name = varchar("name", 255).index(isUnique = true)
}

object Posts : IntIdTable(name = "posts") {
    val board = optReference("board", Boards)
    val parent = optReference("parent", Posts)
}

The full exception with stacktrace (omitting JUnit stuff) is:

java.lang.IllegalStateException: Cycle references detected, can't sort table references!
    at org.jetbrains.exposed.dao.EntityCache$Companion.sortTablesByReferences(Entity.kt:437)
    at org.jetbrains.exposed.sql.SchemaUtils.createStatements(SchemaUtils.kt:15)
    at org.jetbrains.exposed.sql.SchemaUtils.create(SchemaUtils.kt:102)
    at example.TestMetaModels$testCreate$1.invoke(TestMetaModels.kt:22)
    at example.TestMetaModels$testCreate$1.invoke(TestMetaModels.kt:12)
    at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:69)
    at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:57)
    at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:48)
    at example.TestMetaModels.testCreate(TestMetaModels.kt:21)

from exposed.

guredd avatar guredd commented on May 16, 2024

@gcscaglia Thank you for reporting this! Will be fixed very soon.

from exposed.

guredd avatar guredd commented on May 16, 2024

Fixed. Test added.

from exposed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.