Backend Clean Up Operations
Deleting a source
Note that these operations will take a while because of cascading.
DELETE from source where id = <ID>;
-- Clean up timeseries
DELETE FROM timeseries_edge WHERE NOT EXISTS (SELECT * FROM edge WHERE edge.id = timeseries_edge.edge_id);
Switching a source type
Example source was onboarded as a generic source and now there is a dedicated source type.
# Check if source has a connection shell defined
select * from connection where source_id = <SOURCE_ID>
# Find the right CONNECTION_TEMPLATE_ID
select * from connection_template_source_template_map where source_template_id = <SOURCE_TEMPLATE_ID>;
select * from connection_template;
# Add a connection per map record
insert into connection (created_at, updated_at, connection_template_id, source_id, connection_string, active_flag, _username, _password) values (now(), now(), <CONNECTION_TEMPLATE_ID>, <SOURCE_ID>, '', false, '', '')