dave08

    dave08

    10 months ago
    It would be great if SchemaUtils.drop and .create would be smart enough to run the list in the varargs version in an order that would work using references info to know with foreign keys would get in the way...
    e

    Endre Deak

    10 months ago
    I ususally do something like
    val tables = listOf(...) // creation order
    then
    SchemaUtilts.create(*tables.toTypedArray())
    SchemaUtils.drop(*tables.reversed().toTypedArray())
    correct me if I’m wrong but I don’t think Exposed supposed to maintain some meta info about the table hierarchy
    dave08

    dave08

    10 months ago
    They have
    reference("some_field", SomeTable)
    that lets it know about what foreign keys to create and how to join tables...
    e

    Endre Deak

    10 months ago
    true.
    tapac

    tapac

    10 months ago
    @dave08, it should work like this. Do you have an example when tables do not created/dropped in an right order?