package com.satsumasoftware.timetable.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public final class TimetableDbHelper extends SQLiteOpenHelper {

    private static TimetableDbHelper sInstance;

    private static final int DATABASE_VERSION = 1;
    private static final String DATABASE_NAME = "Timetable.db";

    public static synchronized TimetableDbHelper getInstance(Context context) {
        if (sInstance == null) {
            sInstance = new TimetableDbHelper(context.getApplicationContext());
        }
        return sInstance;
    }

    private TimetableDbHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(ClassesSchema.SQL_CREATE);
        db.execSQL(SubjectsSchema.SQL_CREATE);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL(ClassesSchema.SQL_DELETE);
        db.execSQL(SubjectsSchema.SQL_DELETE);
        onCreate(db);
    }

}

@@ -838,201 +838,625 @@
 lass
-esSchema.SQL_CREATE);%0A        db.execSQL(SubjectsSchema.SQL_CREATE);%0A    %7D%0A%0A    @Override%0A    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) %7B%0A        db.execSQL(Class
+DetailsMapSchema.SQL_CREATE);%0A        db.execSQL(ClassDetailsSchema.SQL_CREATE);%0A        db.execSQL(ClassDetailTimesMapSchema.SQL_CREATE);%0A        db.execSQL(ClassesSchema.SQL_CREATE);%0A        db.execSQL(ClassTimesSchema.SQL_CREATE);%0A        db.execSQL(SubjectsSchema.SQL_CREATE);%0A    %7D%0A%0A    @Override%0A    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) %7B%0A        db.execSQL(ClassDetailsMapSchema.SQL_DELETE);%0A        db.execSQL(ClassDetailsSchema.SQL_DELETE);%0A        db.execSQL(ClassDetailTimesMapSchema.SQL_DELETE);%0A        db.execSQL(ClassesSchema.SQL_DELETE);%0A        db.execSQL(ClassTim
 esSc

Add missing creation and deletion SQLite invocations