ent的迁移支持功能，可使数据库 schema 与你项目根目录下的
ent/migrate/schema.go 中定义的 schema 对象保持一致。
ent 部分所需的的数据库资源 。 默认情况下，
默认情况下，每个表的SQL主键从1开始；这意味着不同类型的多个实体可以有相同的ID。 不像AWS Neptune，节点ID是UUID。
This does not work well if you work with GraphQL, which requires the object ID to be unique.
To enable the Universal-IDs support for your project, pass the
WithGlobalUniqueID option to the migration.
How does it work?
ent migration allocates a 1<<32 range for the IDs of each entity (table), and store this information in a table named
ent_types. For example, type
A will have the range of
[1,4294967296) for its IDs, and type
B will have the range of
Note that if this option is enabled, the maximum number of possible tables is 65535.
Offline mode allows you to write the schema changes to an
io.Writer before executing them on the database. It's useful for verifying the SQL commands before they're executed on the database, or to get an SQL script to run manually.
Write changes to a file
ent uses foreign-keys when defining relationships (edges) to enforce correctness and consistency on the database side.
ent also provide an option to disable this functionality using the
WithForeignKeys option. You should note that setting this option to
false, will tell the migration to not create foreign-keys in the schema DDL and the edges validation and clearing must be handled manually by the developer.
We expect to provide a set of hooks for implementing the foreign-key constraints in the application level in the near future.
The framework provides an option to add hooks (middlewares) to the migration phase. This option is ideal for modifying or filtering the tables that the migration is working on, or for creating custom resources in the database.