Package | Description |
---|---|
net.akaish.kitty.orm | |
net.akaish.kitty.orm.dumputils.migrations |
Modifier and Type | Method and Description |
---|---|
KittyORMVersionMigrator |
KittyDatabaseHelper.getCustomMigratorImplementation(android.database.sqlite.SQLiteDatabase database,
int oldVersion,
int newVersion)
Method for getting custom
KittyORMVersionMigrator implementation for this
KittyORM database. |
protected KittyORMVersionMigrator |
KittyDatabaseHelper.getDropCreateVersionMigrator(int oldVersion,
int currentVersion,
android.database.sqlite.SQLiteDatabase database)
Returns default DropCreate migrator that contains only one Migration generated
from create and drop statements fetched from KittyDatabaseHelper.acquireBestDropScriptSequence(int, SQLiteDatabase)
and KittyDatabaseHelper.acquireBestCreateScriptSequence() if possible (if drop script for old schema version
doesn't exists than for getting drop dumped script would be used KittyDatabaseHelper.generateDropTablesScript(String, SQLiteDatabase) ) |
protected KittyORMVersionMigrator |
KittyDatabaseHelper.getFileVersionMigrator(int oldVersion,
int currentVersion)
Returns version migrator from version oldVersion to version currentVersion
|
protected KittyORMVersionMigrator |
KittyDatabaseHelper.getSimpleMigrator(int oldVersion,
int currentVersion,
android.database.sqlite.SQLiteDatabase database) |
Modifier and Type | Method and Description |
---|---|
protected void |
KittyDatabaseHelper.migrate(android.database.sqlite.SQLiteDatabase database,
KittyORMVersionMigrator migrator,
int oldVersion,
int currentVersion)
Tries to migrate from old db version to current with usage of custom migrator
|
Modifier and Type | Class and Description |
---|---|
class |
KittyDevDropCreateMigrator
Class for processing migrations from different versions of schema to current without full sequences.
|
class |
KittyORMVersionFileDumpMigrator
File dump migrator implementation
This migrator looks for all files in specified directory and creates KittyMigration from
them if possible (files are files with name in x-x-x-x.sql pattern, where 'x' are positive integers that are ranges, e.g. minLower-minUpper-maxLower-maxUpper ranges of current migrations scripts) Created by akaish on 05.03.18. |
class |
KittySimpleMigrator
Migrator that returns script automatically generated with
KittySimpleMigrationScriptGenerator
Be aware to use this migrator with database schema that differs with old version in things related with constraints Main idea is that this migrator would do following things: 1) Gets list of existing tables and indexes 2) Generates diff collection without constraint checks on tables and table columns 3) If some of tables in new version would have less fields than old version, old version table would be renamed, new version of table would be created and all values except redundant column values would be copied to new location 4) Is some of tables in new version would have more fields, than would be generated alter table add column query list 5) If new version table has same amount of same named columns as in old version table, nothing would be done 6) If new version tableIndex not present in old schema, it would be created 7) etc Just check KittySimpleMigrationScriptGenerator for more info
Created by akaish on 19.10.18. |