Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #728

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion db/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,7 @@
SET @@system_versioning_alter_history = 1;
ALTER TABLE analysis_runner MODIFY COLUMN config_path VARCHAR(255) NULL;
ALTER TABLE analysis_runner MODIFY COLUMN audit_log_id INT NULL;
ALTER TABLE analysis_runner MODIFY COLUMN script TEXT;
</sql>

<!-- Migrate all the old analysis_runner records into the new table (don't delete existing ones for now) -->
Expand All @@ -1194,7 +1195,12 @@
hail_version, batch_url, submitting_user, meta, audit_log_id ) SELECT
COALESCE(JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.ar-guid')), UUID()) as ar_guid,
analysis.project as project,
CONVERT(JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.timestamp')), DATETIME) as timestamp,
STR_TO_DATE(SUBSTRING_INDEX(JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.timestamp')), '.', 1), '%Y-%m-%dT%H:%i:%s') -- date portion
+ INTERVAL (
60 * SUBSTRING(JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.timestamp')), LENGTH(JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.timestamp'))) - 4, 2) -- hours offset
+ SUBSTRING(JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.timestamp')), LENGTH(JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.timestamp'))) - 1, 2) -- minutes offset
) * (CASE WHEN JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.timestamp')) LIKE '%+%' THEN 1 ELSE -1 END) MINUTE-- +/- offset
as timestamp,
JSON_UNQUOTE(JSON_EXTRACT(analysis.meta,
'$.accessLevel')) as access_level, JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.repo'))
as repository, JSON_UNQUOTE(JSON_EXTRACT(analysis.meta, '$.commit')) as `commit`,
Expand Down
Loading