diff --git a/toolkit/components/places/Database.cpp b/toolkit/components/places/Database.cpp index 10609d2e8a59..c980f315213c 100644 --- a/toolkit/components/places/Database.cpp +++ b/toolkit/components/places/Database.cpp @@ -1225,12 +1225,7 @@ nsresult Database::InitSchema(bool* aDatabaseMigrated) { NS_ENSURE_SUCCESS(rv, rv); } - if (currentSchemaVersion < 62) { - rv = MigrateV62Up(); - NS_ENSURE_SUCCESS(rv, rv); - } - - // Firefox 97 uses schema version 62 + // Firefox 97 uses schema version 61 // Schema Upgrades must add migration code here. // >>> IMPORTANT! <<< @@ -1327,8 +1322,6 @@ nsresult Database::InitSchema(bool* aDatabaseMigrated) { rv = mMainConn->ExecuteSimpleSQL( CREATE_IDX_MOZ_PLACES_METADATA_PLACECREATED); NS_ENSURE_SUCCESS(rv, rv); - rv = mMainConn->ExecuteSimpleSQL(CREATE_IDX_MOZ_PLACES_METADATA_REFERRER); - NS_ENSURE_SUCCESS(rv, rv); // moz_places_metadata_search_queries rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_PLACES_METADATA_SEARCH_QUERIES); @@ -1337,17 +1330,11 @@ nsresult Database::InitSchema(bool* aDatabaseMigrated) { // moz_places_metadata_snapshots rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_PLACES_METADATA_SNAPSHOTS); NS_ENSURE_SUCCESS(rv, rv); - rv = mMainConn->ExecuteSimpleSQL( - CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_PINNNED); - NS_ENSURE_SUCCESS(rv, rv); // moz_places_metadata_snapshots_extra rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_PLACES_METADATA_SNAPSHOTS_EXTRA); NS_ENSURE_SUCCESS(rv, rv); - rv = mMainConn->ExecuteSimpleSQL( - CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_EXTRA_TYPE); - NS_ENSURE_SUCCESS(rv, rv); // moz_places_metadata_snapshots_groups rv = mMainConn->ExecuteSimpleSQL( @@ -2379,32 +2366,6 @@ nsresult Database::MigrateV61Up() { return NS_OK; } -nsresult Database::MigrateV62Up() { - // Add previews tombstones table if necessary. - nsCOMPtr stmt; - nsresult rv = mMainConn->CreateStatement( - "SELECT builder FROM moz_places_metadata_snapshots_groups"_ns, - getter_AddRefs(stmt)); - if (NS_FAILED(rv)) { - rv = mMainConn->ExecuteSimpleSQL( - "ALTER TABLE moz_places " - "ADD COLUMN builder TEXT NOT NULL " - "ADD COLUMN builder_data TEXT "_ns); - NS_ENSURE_SUCCESS(rv, rv); - } - - rv = mMainConn->ExecuteSimpleSQL(CREATE_IDX_MOZ_PLACES_METADATA_REFERRER); - NS_ENSURE_SUCCESS(rv, rv); - rv = mMainConn->ExecuteSimpleSQL( - CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_PINNNED); - NS_ENSURE_SUCCESS(rv, rv); - rv = mMainConn->ExecuteSimpleSQL( - CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_EXTRA_TYPE); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - nsresult Database::ConvertOldStyleQuery(nsCString& aURL) { AutoTArray tokens; nsresult rv = TokenizeQueryString(aURL, &tokens); diff --git a/toolkit/components/places/Database.h b/toolkit/components/places/Database.h index dd7a3c110e8d..bfa526b648ff 100644 --- a/toolkit/components/places/Database.h +++ b/toolkit/components/places/Database.h @@ -18,7 +18,7 @@ // This is the schema version. Update it at any schema change and add a // corresponding migrateVxx method below. -#define DATABASE_SCHEMA_VERSION 62 +#define DATABASE_SCHEMA_VERSION 61 // Fired after Places inited. #define TOPIC_PLACES_INIT_COMPLETE "places-init-complete" @@ -334,7 +334,6 @@ class Database final : public nsIObserver, public nsSupportsWeakReference { nsresult MigrateV59Up(); nsresult MigrateV60Up(); nsresult MigrateV61Up(); - nsresult MigrateV62Up(); void MigrateV52OriginFrecencies(); diff --git a/toolkit/components/places/nsPlacesIndexes.h b/toolkit/components/places/nsPlacesIndexes.h index ee506a50ca41..8b66c9c24207 100644 --- a/toolkit/components/places/nsPlacesIndexes.h +++ b/toolkit/components/places/nsPlacesIndexes.h @@ -108,18 +108,4 @@ CREATE_PLACES_IDX("placecreated_uniqueindex", "moz_places_metadata", \ "place_id, created_at", "UNIQUE") -#define CREATE_IDX_MOZ_PLACES_METADATA_REFERRER \ - CREATE_PLACES_IDX("referrerindex", "moz_places_metadata", \ - "referrer_place_id", "") - -// moz_places_metadata_snapshots -#define CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_PINNNED \ - CREATE_PLACES_IDX("pinnedindex", "moz_places_metadata_snapshots", \ - "user_persisted, last_interaction_at", "") - -// moz_places_metadata_snapshots_extra -#define CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_EXTRA_TYPE \ - CREATE_PLACES_IDX("typeindex", "moz_places_metadata_snapshots_extra", \ - "type", "") - #endif // nsPlacesIndexes_h__ diff --git a/toolkit/components/places/nsPlacesTables.h b/toolkit/components/places/nsPlacesTables.h index 839427dcad6a..89a571b55954 100644 --- a/toolkit/components/places/nsPlacesTables.h +++ b/toolkit/components/places/nsPlacesTables.h @@ -334,9 +334,7 @@ nsLiteralCString( \ "CREATE TABLE IF NOT EXISTS moz_places_metadata_snapshots_groups ( " \ " id INTEGER PRIMARY KEY, " \ - " title TEXT NOT NULL, " \ - " builder TEXT NOT NULL, " \ - " builder_data TEXT " \ + " title TEXT NOT NULL " \ ")") #define CREATE_MOZ_PLACES_METADATA_GROUPS_TO_SNAPSHOTS \ diff --git a/toolkit/components/places/tests/migration/head_migration.js b/toolkit/components/places/tests/migration/head_migration.js index ef8d63742864..5978723ada53 100644 --- a/toolkit/components/places/tests/migration/head_migration.js +++ b/toolkit/components/places/tests/migration/head_migration.js @@ -15,7 +15,7 @@ var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); // Put any other stuff relative to this test folder below. -const CURRENT_SCHEMA_VERSION = 62; +const CURRENT_SCHEMA_VERSION = 61; const FIRST_UPGRADABLE_SCHEMA_VERSION = 43; async function assertAnnotationsRemoved(db, expectedAnnos) { diff --git a/toolkit/components/places/tests/migration/places_v62.sqlite b/toolkit/components/places/tests/migration/places_v61.sqlite similarity index 92% rename from toolkit/components/places/tests/migration/places_v62.sqlite rename to toolkit/components/places/tests/migration/places_v61.sqlite index 06348983ef9f..f28ba0ae5125 100644 Binary files a/toolkit/components/places/tests/migration/places_v62.sqlite and b/toolkit/components/places/tests/migration/places_v61.sqlite differ diff --git a/toolkit/components/places/tests/migration/test_current_from_v54.js b/toolkit/components/places/tests/migration/test_current_from_v54.js index 886e5d18d477..507234100fb1 100644 --- a/toolkit/components/places/tests/migration/test_current_from_v54.js +++ b/toolkit/components/places/tests/migration/test_current_from_v54.js @@ -47,29 +47,3 @@ add_task(async function previews_tombstones_in_database() { let db = await PlacesUtils.promiseDBConnection(); await db.execute(`SELECT hash FROM moz_previews_tombstones`); }); - -add_task(async function builder_fields_in_database() { - let db = await PlacesUtils.promiseDBConnection(); - await db.execute( - `SELECT builder, builder_data FROM moz_places_metadata_snapshots_groups` - ); - - let rows = await db.execute( - `SELECT * FROM sqlite_master WHERE type = "index"` - ); - - let indexes = rows.map(r => r.getResultByName("name")); - - Assert.ok( - indexes.includes("moz_places_metadata_referrerindex"), - "Should contain the referrer index" - ); - Assert.ok( - indexes.includes("moz_places_metadata_snapshots_pinnedindex"), - "Should contain the pinned index" - ); - Assert.ok( - indexes.includes("moz_places_metadata_snapshots_extra_typeindex"), - "Should contain the type index" - ); -}); diff --git a/toolkit/components/places/tests/migration/xpcshell.ini b/toolkit/components/places/tests/migration/xpcshell.ini index ca7eaa2cbb71..f44b4f807731 100644 --- a/toolkit/components/places/tests/migration/xpcshell.ini +++ b/toolkit/components/places/tests/migration/xpcshell.ini @@ -6,7 +6,7 @@ support-files = places_outdated.sqlite places_v43.sqlite places_v54.sqlite - places_v62.sqlite + places_v61.sqlite [test_current_from_downgraded.js] [test_current_from_outdated.js]