Fossil SCM

Reverse the order of column/table existence checking to make validation of already updated local database faster.

dmitry 2011-08-27 01:21 symlinks
Commit 8c0f4bc718cb0c6cc4526958a201bbcbbc719e33
1 file changed +6 -6
+6 -6
--- src/db.c
+++ src/db.c
@@ -786,20 +786,20 @@
786786
** After all users have upgraded, this code can be safely deleted.
787787
*/
788788
if( !db_local_column_exists("vfile", "islink") )
789789
db_multi_exec("ALTER TABLE vfile ADD COLUMN islink BOOLEAN DEFAULT 0");
790790
791
- if( db_local_table_exists("stashfile") &&
792
- !db_local_column_exists("stashfile", "isLink") )
791
+ if( !db_local_column_exists("stashfile", "isLink") &&
792
+ db_local_table_exists("stashfile") )
793793
db_multi_exec("ALTER TABLE stashfile ADD COLUMN isLink BOOLEAN DEFAULT 0");
794794
795
- if( db_local_table_exists("undo") &&
796
- !db_local_column_exists("undo", "isLink") )
795
+ if( !db_local_column_exists("undo", "isLink") &&
796
+ db_local_table_exists("undo") )
797797
db_multi_exec("ALTER TABLE undo ADD COLUMN isLink BOOLEAN DEFAULT 0");
798798
799
- if( db_local_table_exists("undo_vfile") &&
800
- !db_local_column_exists("undo_vfile", "islink") )
799
+ if( !db_local_column_exists("undo_vfile", "islink") &&
800
+ db_local_table_exists("undo_vfile") )
801801
db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOLEAN DEFAULT 0");
802802
803803
return 1;
804804
}
805805
806806
--- src/db.c
+++ src/db.c
@@ -786,20 +786,20 @@
786 ** After all users have upgraded, this code can be safely deleted.
787 */
788 if( !db_local_column_exists("vfile", "islink") )
789 db_multi_exec("ALTER TABLE vfile ADD COLUMN islink BOOLEAN DEFAULT 0");
790
791 if( db_local_table_exists("stashfile") &&
792 !db_local_column_exists("stashfile", "isLink") )
793 db_multi_exec("ALTER TABLE stashfile ADD COLUMN isLink BOOLEAN DEFAULT 0");
794
795 if( db_local_table_exists("undo") &&
796 !db_local_column_exists("undo", "isLink") )
797 db_multi_exec("ALTER TABLE undo ADD COLUMN isLink BOOLEAN DEFAULT 0");
798
799 if( db_local_table_exists("undo_vfile") &&
800 !db_local_column_exists("undo_vfile", "islink") )
801 db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOLEAN DEFAULT 0");
802
803 return 1;
804 }
805
806
--- src/db.c
+++ src/db.c
@@ -786,20 +786,20 @@
786 ** After all users have upgraded, this code can be safely deleted.
787 */
788 if( !db_local_column_exists("vfile", "islink") )
789 db_multi_exec("ALTER TABLE vfile ADD COLUMN islink BOOLEAN DEFAULT 0");
790
791 if( !db_local_column_exists("stashfile", "isLink") &&
792 db_local_table_exists("stashfile") )
793 db_multi_exec("ALTER TABLE stashfile ADD COLUMN isLink BOOLEAN DEFAULT 0");
794
795 if( !db_local_column_exists("undo", "isLink") &&
796 db_local_table_exists("undo") )
797 db_multi_exec("ALTER TABLE undo ADD COLUMN isLink BOOLEAN DEFAULT 0");
798
799 if( !db_local_column_exists("undo_vfile", "islink") &&
800 db_local_table_exists("undo_vfile") )
801 db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOLEAN DEFAULT 0");
802
803 return 1;
804 }
805
806

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button