--- /dev/null
+package adullact.publicrowdfunding.model.local.database;
+
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+import adullact.publicrowdfunding.PublicrowdFundingApplication;
+
+/**
+ * @author Ferrand and Nelaupe
+ */
+public final class ProjectsDatabaseHelper extends SQLiteOpenHelper {
+ public static final int DATABASE_VERSION = 1;
+ public static final String DATABASE_NAME = "PublicrowFunding.db";
+
+ public ProjectsDatabaseHelper() {
+ super(PublicrowdFundingApplication.context(), DATABASE_NAME, null, DATABASE_VERSION);
+ }
+
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(ProjectsTable.SQL_CREATE);
+ }
+
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ // This database is only a cache for online data, so its upgrade policy is
+ // to simply to discard the data and start over
+ db.execSQL(ProjectsTable.SQL_DELETE);
+ onCreate(db);
+ }
+ public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ onUpgrade(db, oldVersion, newVersion);
+ }
+
+
+}