0

During the creation of some data on the production server by our backend, an unexpected error occurred and some data became inaccessible. Currently, a fix is being found for the error, but the flawed data is still on the server, causing some trouble. This can easily be fixed by setting some data to NULL. Our backend uses the Spring framework and Liquibase to update the schema when necessary. Our production server is maintained by a different company and is unaccessible for us (the developers). The other company wants us to write an entry for the Liquibase XML file to fix this.

The question is: do we change the XML file, run a query normally or is there anything else we can do? The reason I'm asking this is because we feel like this is not the way Liquibase should be used. (It's not a database schema change.)

Note: we are running more than just the production environment, so by adding the query to the Liquibase XML file, it will run on all environments.

  • truncate all tables then create the data using fixed procedure. – Akina Jan 14 at 13:11
  • There is already a lot of data on the production server, this is not a fresh start. – Mart Jan 14 at 13:17
  • If so then create and execute query or stored procedure which will check the data, find problematic rows and set problematic values to NULL. Then apply fixing procedure (if exists) which will alter NULLs to correct values (if needed). by adding the query to the Liquibase XML file, it will run on all environments The query may check a lot of parameters in WHERE clause and perform the action only if they match to the problematic environment. Something like UPDATE table SET column = NULL WHERE DATABASE() = 'problematic_database' AND (another conditions which detects wrong values); – Akina Jan 14 at 13:25
  • Not sure what your question is here. Follow the procedure established by those who maintain your production environment. – mustaccio Jan 14 at 21:08
  • 1
    This should be managed for a DBA. Running a script directly in DB (Data Fix) is the best approach here. – Jesus Uzcanga Jan 17 at 15:45

Browse other questions tagged or ask your own question.