Fossil SCM
Reverse the order of column/table existence checking to make validation of already updated local database faster.
Commit
8c0f4bc718cb0c6cc4526958a201bbcbbc719e33
Parent
44e673f5e992c67…
1 file changed
+6
-6
M
src/db.c
+6
-6
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -786,20 +786,20 @@ | ||
| 786 | 786 | ** After all users have upgraded, this code can be safely deleted. |
| 787 | 787 | */ |
| 788 | 788 | if( !db_local_column_exists("vfile", "islink") ) |
| 789 | 789 | db_multi_exec("ALTER TABLE vfile ADD COLUMN islink BOOLEAN DEFAULT 0"); |
| 790 | 790 | |
| 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") ) | |
| 793 | 793 | db_multi_exec("ALTER TABLE stashfile ADD COLUMN isLink BOOLEAN DEFAULT 0"); |
| 794 | 794 | |
| 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") ) | |
| 797 | 797 | db_multi_exec("ALTER TABLE undo ADD COLUMN isLink BOOLEAN DEFAULT 0"); |
| 798 | 798 | |
| 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") ) | |
| 801 | 801 | db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOLEAN DEFAULT 0"); |
| 802 | 802 | |
| 803 | 803 | return 1; |
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 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_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 |