public interface DatabaseAdmin
| Modifier and Type | Field and Description |
|---|---|
static String |
DATA_FILENAME
Property key for populate database
|
static String |
DATABASE_NAME
Property key for database name
|
static String |
DATABASE_VERSION
Property key for database version
|
static String |
DROP_SCHEMA_FILENAME
Property key for drop database
|
static String |
SCHEMA_FILENAME
Property key for create database
|
static String |
UPGRADE_FILENAME_FORMAT
Property key for update database.
|
| Modifier and Type | Method and Description |
|---|---|
OpenHelperCallbacks |
getCustomOpenHelperCallbacks() |
void |
onCreate(com.j256.ormlite.support.ConnectionSource connectionSource)
To support android.database.sqlite.SQLiteOpenHelper
Called when the database is created for the first time.
|
void |
onUpgrade(com.j256.ormlite.support.ConnectionSource connectionSource,
int oldVersion,
int newVersion)
See android.database.sqlite.SQLiteOpenHelper
Called when the database needs to be upgraded.
|
static final String SCHEMA_FILENAME
static final String DROP_SCHEMA_FILENAME
static final String DATA_FILENAME
static final String UPGRADE_FILENAME_FORMAT
static final String DATABASE_VERSION
static final String DATABASE_NAME
void onCreate(com.j256.ormlite.support.ConnectionSource connectionSource)
connectionSource - Open Connection Sourcevoid onUpgrade(com.j256.ormlite.support.ConnectionSource connectionSource,
int oldVersion,
int newVersion)
The SQLite ALTER TABLE documentation can be found here. If you add new columns you can use ALTER TABLE to insert them into a live table. If you rename or remove columns you can use ALTER TABLE to rename the old table, then create the new table and then populate the new table with the contents of the old table.
This method executes within a transaction. If an exception is thrown, all changes will automatically be rolled back.
connectionSource - Open Connection SourceoldVersion - The old database version.newVersion - The new database version.OpenHelperCallbacks getCustomOpenHelperCallbacks()
This documentation is licensed by Andrew Bowley under the GPLv3 License.