~dhis2-academy/dhis2-academy/android

« back to all changes in this revision

Viewing changes to dhis-mobile/dhis-androidApp/src/org/hisp/dhis/storage/DatabaseHelper.java

  • Committer: Johannes Joch
  • Date: 2010-11-23 20:26:27 UTC
  • Revision ID: johannjo@ulrik.uio.no-20101123202627-gwds02nfkcmk6kqi
OrgUnits can be created by also setting the id that doesn't get assigned automaticly. Also some more progress on the DataSets

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
     * Database creation sql statement
12
12
     */
13
13
    private static final String TABLE_CREATE_ORGUNIT =
14
 
        "create table orgUnits (_id integer primary key autoincrement, "
 
14
        "create table orgUnits (_id integer primary key, "
15
15
        + "name text not null, father text not null);";
16
16
    private static final String TABLE_CREATE_DATASET =
17
17
        "create table dataSets (_id integer primary key autoincrement, "
39
39
        Log.w(TAG, "Upgrading database from version " + oldVersion + " to "
40
40
                + newVersion + ", which will destroy all old data");
41
41
        db.execSQL("DROP TABLE IF EXISTS orgUnits");
 
42
        db.execSQL("DROP TABLE IF EXISTS dataSets");
 
43
        db.execSQL("DROP TABLE IF EXISTS orgUntisDataSets");
42
44
        onCreate(db);
43
45
    }
44
46
}