命令行
少于1分钟
Command Line 命令行
Command Line 命令行
You can call orm.RunCommand() after you registered models and database(s) as follows:
在注册模型和数据库后,您可以按如下方式调用 orm.RunCommand() :
| |
Database Schema Generation 数据库架构生成
| |
Use the -force=1 flag to force drop tables and re-create.
使用 -force=1 标志强制删除表并重新创建。
Use the -v flag to print SQL statements.
使用 -v 标志打印 SQL 语句。
Use program to create tables:
使用程序创建表:
| |
Even if you do not enable force mode, ORM also will auto-add new fields and indexes, but you have to deal with delete operations yourself.
即使您未启用 force 模式,ORM 也会自动添加新字段和索引,但您必须自己处理删除操作。
Print SQL Statements 打印 SQL 语句
| |
Use database with alias default as default.
使用具有别名 default 的数据库作为默认数据库。