# # # patch "database.cc" # from [782fe442be38102309140cac08d6d9f304cc233b] # to [bb789527cfbe11aa666c91ad3b596e23d7f915e7] # # patch "schema.sql" # from [83bbd8274486f892916f6b82b665c1b28fb670b5] # to [ca45d5c2ea34898e182446dbab198bb821aa1e3c] # # patch "schema_migration.cc" # from [bf93c9946d91eb904ce2fe89a85bf50a60687c67] # to [940a3d0faf31a930d96bb94ff76a1a283490c618] # ============================================================ --- database.cc 782fe442be38102309140cac08d6d9f304cc233b +++ database.cc bb789527cfbe11aa666c91ad3b596e23d7f915e7 @@ -72,7 +72,7 @@ // non-alphabetic ordering of tables in sql source files. we could create // a temporary db, write our intended schema into it, and read it back, // but this seems like it would be too rude. possibly revisit this issue. - schema("2d7ffb7c3d2975b52d2c799d511b7aea196c7adf"), + schema("a83f7d2b5e1118f676011706f4e269796c9d17c7"), __sql(NULL), transaction_level(0) {} ============================================================ --- schema.sql 83bbd8274486f892916f6b82b665c1b28fb670b5 +++ schema.sql ca45d5c2ea34898e182446dbab198bb821aa1e3c @@ -23,10 +23,10 @@ ( id primary key, -- strong hash of file contents data not null -- compressed contents of a file - ); + ); CREATE TABLE file_deltas - ( + ( id not null, -- strong hash of file contents base not null, -- joins with files.id or file_deltas.id delta not null, -- compressed rdiff to construct current from base @@ -42,7 +42,7 @@ CREATE TABLE manifest_deltas ( id not null, -- strong hash of all the entries in a manifest - base not null, -- joins with either manifest.id or manifest_deltas.id + base not null, -- joins with either manifests.id or manifest_deltas.id delta not null, -- compressed rdiff to construct current from base unique(id, base) ); ============================================================ --- schema_migration.cc bf93c9946d91eb904ce2fe89a85bf50a60687c67 +++ schema_migration.cc 940a3d0faf31a930d96bb94ff76a1a283490c618 @@ -951,12 +951,10 @@ char ** errmsg, app_state *app) { + if (!migrate_files_BLOB(sql,errmsg,app)) + return false; + int res; -// app->db.install_functions(app); - I(sqlite3_create_function(sql, "unbase64", -1, - SQLITE_UTF8, NULL, - &sqlite3_unbase64_fn, - NULL, NULL) == 0); // change the encoding of manifest(_delta)s if (!move_table(sql, errmsg, @@ -999,7 +997,7 @@ res = logged_sqlite3_exec(sql, "CREATE TABLE manifest_deltas\n" "(\n" "id not null, -- strong hash of all the entries in a manifest\n" - "base not null, -- joins with manifests.id or manifest_deltas.id\n" + "base not null, -- joins with either manifests.id or manifest_deltas.id\n" "delta not null, -- compressed rdiff to construct current from base\n" "unique(id, base)\n" ")", NULL, NULL, errmsg); @@ -1049,14 +1047,11 @@ &migrate_client_to_external_privkeys); m.add("bd86f9a90b5d552f0be1fa9aee847ea0f317778b", - &migrate_files_BLOB); - - m.add("acf96bb0bd230523fe5fa7621864fa252c3cf11c", &migrate_manifests_BLOB); // IMPORTANT: whenever you modify this to add a new schema version, you must // also add a new migration test for the new schema version. See // tests/t_migrate_schema.at for details. - m.migrate(sql, "2d7ffb7c3d2975b52d2c799d511b7aea196c7adf"); + m.migrate(sql, "a83f7d2b5e1118f676011706f4e269796c9d17c7"); }