-- Do NOT use XML/SQL to relocate TECH_FUTURE_TECH
-- Shift all our modified techs relative to where we EXPECT TECH_FUTURE_TECH to be
UPDATE Technologies SET GridX = GridX + (SELECT GridX FROM Technologies WHERE Type='TECH_FUTURE_TECH') - 17
    WHERE Type IN ('TECH_ENVIRONMENTALISM', 'TECH_CLONING', 'TECH_GEN_MANIP', 'TECH_MEMETICS', 'TECH_GRID_COMPUTING', 'TECH_TRANSGENICS', 'TECH_AUTONOMOUS_SYSTEMS',
                   'TECH_NANOMATERIALS', 'TECH_SUPERCONDUCTIVITY', 'TECH_ARTIFICIAL_ENVIRONMENTS', 'TECH_ECOSOPHY', 'TECH_IMPLANTS', 
				   'TECH_NEURAL_INTERFACE', 'TECH_COGNITIVE_TECH', 'TECH_QUANTUM_COMPUTERS', 'TECH_ORBITAL_DEV', 'TECH_GENGINEERING',
				   'TECH_BIOMODIFICATION', 'TECH_CYBERNETICS', 'TECH_AI', 'TECH_ADAMANTIUM', 'TECH_ARCOLOGIES', 'TECH_TERRAFORMING',
				   'TECH_HOMO_SUPERIOR', 'TECH_DIGITAL_SOCIETY', 'TECH_SMART_MATERIALS', 'TECH_HYPERSTRUCTURES', 'TECH_ENERGY_THEORY',
 				   'TECH_HUMAN_AUGMENTATION', 'TECH_COMPUTRONIUM', 'TECH_SPACE_COLONIZATION', 'TECH_NANOTECHNOLOGY', 'TECH_NUCLEAR_FUSION');

-- Now shift TECH_FUTURE_TECH to the end of the tree
UPDATE Technologies
    SET GridX = (SELECT GridX FROM Technologies ORDER BY GridX DESC LIMIT 1) + 1
    WHERE Type='TECH_FUTURE_TECH';