如何使用 Kotlin Exposed 框架重命名数据库中的现有表?

问题描述 投票:0回答:2

我找不到任何关于如何使用 Kotlin Exposed 框架重命名数据库中的现有表的信息?如果可能的话,请给我任何解释。提前谢谢你。

我阅读了所有官方文档,但没有找到任何相关信息。

ddl kotlin-exposed
2个回答
0
投票

你可以像这样使用执行语句函数。

transaction {
    exec("alter table [old_table_name] rename to [new_table_name]")
}

0
投票

类似的东西

private fun rename() = transaction {
    db.connector().prepareStatement("alter table [old_table_name] rename to [new_table_name]", false)
}
© www.soinside.com 2019 - 2024. All rights reserved.