Cleanup upgrade from 4.2.0 to 4.2.1
This commit is contained in:
		
							parent
							
								
									fbd9935f3e
								
							
						
					
					
						commit
						ca8b110dc1
					
				@ -14,33 +14,3 @@
 | 
				
			|||||||
-- limitations under the License.
 | 
					-- limitations under the License.
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- UPDATE OTA PACKAGE EXTERNAL ID START
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ALTER TABLE ota_package
 | 
					 | 
				
			||||||
    ADD COLUMN IF NOT EXISTS external_id uuid;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
DO
 | 
					 | 
				
			||||||
$$
 | 
					 | 
				
			||||||
    BEGIN
 | 
					 | 
				
			||||||
        IF NOT EXISTS(SELECT 1 FROM pg_constraint WHERE conname = 'ota_package_external_id_unq_key') THEN
 | 
					 | 
				
			||||||
            ALTER TABLE ota_package ADD CONSTRAINT ota_package_external_id_unq_key UNIQUE (tenant_id, external_id);
 | 
					 | 
				
			||||||
        END IF;
 | 
					 | 
				
			||||||
    END;
 | 
					 | 
				
			||||||
$$;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- UPDATE OTA PACKAGE EXTERNAL ID END
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- DROP INDEXES THAT DUPLICATE UNIQUE CONSTRAINT START
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
DROP INDEX IF EXISTS idx_device_external_id;
 | 
					 | 
				
			||||||
DROP INDEX IF EXISTS idx_device_profile_external_id;
 | 
					 | 
				
			||||||
DROP INDEX IF EXISTS idx_asset_external_id;
 | 
					 | 
				
			||||||
DROP INDEX IF EXISTS idx_entity_view_external_id;
 | 
					 | 
				
			||||||
DROP INDEX IF EXISTS idx_rule_chain_external_id;
 | 
					 | 
				
			||||||
DROP INDEX IF EXISTS idx_dashboard_external_id;
 | 
					 | 
				
			||||||
DROP INDEX IF EXISTS idx_customer_external_id;
 | 
					 | 
				
			||||||
DROP INDEX IF EXISTS idx_widgets_bundle_external_id;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- DROP INDEXES THAT DUPLICATE UNIQUE CONSTRAINT END
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ALTER TABLE mobile_app ADD COLUMN IF NOT EXISTS title varchar(255);
 | 
					 | 
				
			||||||
@ -32,7 +32,7 @@ public class DefaultDatabaseSchemaSettingsService implements DatabaseSchemaSetti
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // This list should include all versions which are compatible for the upgrade.
 | 
					    // This list should include all versions which are compatible for the upgrade.
 | 
				
			||||||
    // The compatibility cycle usually breaks when we have some scripts written in Java that may not work after new release.
 | 
					    // The compatibility cycle usually breaks when we have some scripts written in Java that may not work after new release.
 | 
				
			||||||
    private static final List<String> SUPPORTED_VERSIONS_FOR_UPGRADE = List.of("4.1.0");
 | 
					    private static final List<String> SUPPORTED_VERSIONS_FOR_UPGRADE = List.of("4.2.0");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final ProjectInfo projectInfo;
 | 
					    private final ProjectInfo projectInfo;
 | 
				
			||||||
    private final JdbcTemplate jdbcTemplate;
 | 
					    private final JdbcTemplate jdbcTemplate;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user