         "type INTEGER NOT NULL, " +
         "date REAL NOT NULL" +
         ") "
+
+        let history =
+        "CREATE TABLE IF NOT EXISTS \(TableHistory) (" +
+        "id INTEGER PRIMARY KEY AUTOINCREMENT, " +
+        "guid TEXT NOT NULL UNIQUE, " +       // Not null, but the value might be replaced by the server's.
+        "url TEXT UNIQUE, " +                 // May only be null for deleted records.
+        "title TEXT NOT NULL, " +
+        "server_modified INTEGER, " +         // Can be null. Integer milliseconds.
+        "local_modified INTEGER, " +          // Can be null. Client clock. In extremis only.
+        "is_deleted TINYINT NOT NULL, " +     // Boolean. Locally deleted.
+        "should_upload TINYINT NOT NULL, " +  // Boolean. Set when changed or visits added.
+        "domain_id INTEGER REFERENCES \(TableDomains)(id) ON DELETE CASCADE, " +
+        "CONSTRAINT urlOrDeleted CHECK (url IS NOT NULL OR is_deleted = 1)" +
+        ")"
 
         // Right now we don't need to track per-visit deletions: Sync can't
         // represent them! See Bug 1157553 Comment 6.

            widestFavicons,
            historyIDsWithIcon,
            iconForURL,
            getQueueTableCreationString(),
            getTopSitesTableCreationString(),
        ]

        assert(queries.count == AllTablesIndicesAndViews.count, "Did you forget to add your table, index, or view to the list?")

        return self.run(db, sql: sql, args: args)
    }

    let topSitesTableCreate =
        "CREATE TABLE IF NOT EXISTS \(TableCachedTopSites) (" +
            "historyID INTEGER, " +
            "url TEXT NOT NULL, " +
            "title TEXT NOT NULL, " +
