Skip to content
Snippets Groups Projects
Commit a5613d1c authored by kfilippopolitis's avatar kfilippopolitis
Browse files

Reverting back changes to 7_0 migration script.Adding the new changes to a new...

Reverting back changes to 7_0 migration script.Adding the new changes to a new 7_1 migration script.
parent 56a402e9
No related branches found
No related tags found
1 merge request!21Bug-482/output_error_on_old_experiments
UPDATE experiment
SET algorithms =
(
SELECT SUBSTR(algorithms, 2, LENGTH(algorithms) - 2)
);
UPDATE experiment
SET workflowstatus = 'error'
......@@ -21,21 +26,27 @@ DROP COLUMN hasservererror,
DROP COLUMN validations,
DROP COLUMN model_slug;
ALTER TABLE experiment RENAME algorithms TO algorithm;
UPDATE experiment SET algorithm = (algorithm::json ->> 0);
ALTER TABLE experiment ADD COLUMN algorithmId text;
UPDATE experiment SET algorithmId = (algorithm::json ->> 'name');
UPDATE experiment SET result = result::json #>>'{0,result}' WHERE (algorithm::json->>'type') <> 'workflow';
ALTER TABLE experiment
RENAME createdby_username TO created_by_username;
RENAME algorithms TO algorithm;
ALTER TABLE experiment
ALTER COLUMN algorithm TYPE json USING algorithm::json;
ALTER TABLE experiment
RENAME workflowhistoryid TO workflow_history_id;
RENAME createdby_username TO created_by_username;
ALTER TABLE experiment
RENAME resultsviewed TO viewed;
RENAME workflowhistoryid TO workflow_history_id;
ALTER TABLE experiment
RENAME workflowstatus TO status;
RENAME resultsviewed TO viewed;
ALTER TABLE experiment
RENAME workflowstatus TO status;
ALTER TABLE experiment
ADD COLUMN algorithmId text;
UPDATE experiment
SET algorithmId = (algorithm ->> 'name');
ALTER TABLE experiment
ALTER COLUMN algorithm TYPE text;
ALTER TABLE experiment
ADD COLUMN updated timestamp without time zone;
......@@ -70,4 +81,4 @@ DROP TABLE "query";
DROP TABLE "dataset";
DROP TABLE "config";
DROP TABLE "vote", "app";
DROP TABLE "user_roles", "user_languages";
DROP TABLE "user_roles", "user_languages";
\ No newline at end of file
UPDATE experiment SET result = result::json #>>'{0,result}' WHERE (algorithm::json->>'type') <> 'workflow';
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment