I'm using PostgreSQL. I need to drop the tables cascade, here is a code snippet from Scala-Forklift I need to override it in order to drop tables despite unknown foreign keys:
override def reset = {
val drop = MTable.getTables(None, None, None, None).flatMap { s =>
DBIO.sequence(s filter { t =>
t.tableType != null && t.tableType.toLowerCase == "table"
} map { t =>
TableQuery(new DummyTable(_, t.name.name)).schema.drop
})
}
val f = db.run(drop)
Await.result(f, Duration.Inf)
}
But I don't know how. Is it possible with the slick schemas? If not, can you please give me an example how to do it with SQL integrated in this method for all Tables in "MTable"?
Thank you very much in advance!