/**
*
*/
package dbAdapter;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
class DatabaseHelper extends SQLiteOpenHelper {
static final String DATABASE_NAME = "295ProjectDB";
static final int DATABASE_VERSION = 2;
DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(FoodDBAdapter.CREATE_TABLE);
db.execSQL(ProfileDBAdapter.CREATE_TABLE1); // Profile Table
db.execSQL(DailyInfoDBAdapter1.DATABASE_CREATE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.w("DatabaseHelper", "Upgrading database from version " + oldVersion + " to "
+ newVersion + ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS notes");
onCreate(db);
}
}
|