public abstract class OrmMigration extends Object
If you need to modify the database structure, for example, add a table or field, you need to create
a database class, specify the new database version, and then prepare an SQL statement for upgrading or downgrading
between the start and end versions specified by OrmMigration(int, int). The ORM annotation processor will identify
the start and end version, and execute the specified SQL statement to complete the upgrade or downgrade.
SystemCapability.Data#DATA_APPDATAMGR| 构造器 | 说明 |
|---|---|
OrmMigration(int beginVersion,
int endVersion) |
Constructor of this class for upgrading or downgrading from the start version to the end version.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getBeginVersion() |
Obtains the value of variable
beginVersion. |
int |
getEndVersion() |
Obtains the value of variable
endVersion. |
abstract void |
onMigrate(RdbStore store) |
Upgrades or downgrades the database.
|
public OrmMigration(int beginVersion,
int endVersion)
beginVersion - Indicates the start version.endVersion - Indicates the end version.