diff --git a/mobile/android/base/db/BrowserDatabaseHelper.java b/mobile/android/base/db/BrowserDatabaseHelper.java index 64be4d8450d..daf02f056ba 100644 --- a/mobile/android/base/db/BrowserDatabaseHelper.java +++ b/mobile/android/base/db/BrowserDatabaseHelper.java @@ -74,14 +74,6 @@ final class BrowserDatabaseHelper extends SQLiteOpenHelper { private void createBookmarksTable(SQLiteDatabase db) { debug("Creating " + TABLE_BOOKMARKS + " table"); - // Android versions older than Froyo ship with an sqlite - // that doesn't support foreign keys. - String foreignKeyOnParent = null; - if (Build.VERSION.SDK_INT >= 8) { - foreignKeyOnParent = ", FOREIGN KEY (" + Bookmarks.PARENT + - ") REFERENCES " + TABLE_BOOKMARKS + "(" + Bookmarks._ID + ")"; - } - db.execSQL("CREATE TABLE " + TABLE_BOOKMARKS + "(" + Bookmarks._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + Bookmarks.TITLE + " TEXT," + @@ -95,8 +87,9 @@ final class BrowserDatabaseHelper extends SQLiteOpenHelper { Bookmarks.DATE_CREATED + " INTEGER," + Bookmarks.DATE_MODIFIED + " INTEGER," + Bookmarks.GUID + " TEXT NOT NULL," + - Bookmarks.IS_DELETED + " INTEGER NOT NULL DEFAULT 0" + - (foreignKeyOnParent != null ? foreignKeyOnParent : "") + + Bookmarks.IS_DELETED + " INTEGER NOT NULL DEFAULT 0, " + + "FOREIGN KEY (" + Bookmarks.PARENT + ") REFERENCES " + + TABLE_BOOKMARKS + "(" + Bookmarks._ID + ")" + ");"); db.execSQL("CREATE INDEX bookmarks_url_index ON " + TABLE_BOOKMARKS + "(" @@ -112,14 +105,6 @@ final class BrowserDatabaseHelper extends SQLiteOpenHelper { private void createBookmarksTableOn13(SQLiteDatabase db) { debug("Creating " + TABLE_BOOKMARKS + " table"); - // Android versions older than Froyo ship with an sqlite - // that doesn't support foreign keys. - String foreignKeyOnParent = null; - if (Build.VERSION.SDK_INT >= 8) { - foreignKeyOnParent = ", FOREIGN KEY (" + Bookmarks.PARENT + - ") REFERENCES " + TABLE_BOOKMARKS + "(" + Bookmarks._ID + ")"; - } - db.execSQL("CREATE TABLE " + TABLE_BOOKMARKS + "(" + Bookmarks._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + Bookmarks.TITLE + " TEXT," + @@ -134,8 +119,9 @@ final class BrowserDatabaseHelper extends SQLiteOpenHelper { Bookmarks.DATE_CREATED + " INTEGER," + Bookmarks.DATE_MODIFIED + " INTEGER," + Bookmarks.GUID + " TEXT NOT NULL," + - Bookmarks.IS_DELETED + " INTEGER NOT NULL DEFAULT 0" + - (foreignKeyOnParent != null ? foreignKeyOnParent : "") + + Bookmarks.IS_DELETED + " INTEGER NOT NULL DEFAULT 0, " + + "FOREIGN KEY (" + Bookmarks.PARENT + ") REFERENCES " + + TABLE_BOOKMARKS + "(" + Bookmarks._ID + ")" + ");"); db.execSQL("CREATE INDEX bookmarks_url_index ON " + TABLE_BOOKMARKS + "("