It would be great if SchemaUtils.drop and .create ...
# exposed
d
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
I ususally do something like
Copy code
val tables = listOf(...) // creation order
then
Copy code
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
d
They have
reference("some_field", SomeTable)
that lets it know about what foreign keys to create and how to join tables...
e
true.
t
@dave08, it should work like this. Do you have an example when tables do not created/dropped in an right order?