Skip to content

Fix rfc3339 datetime migration #1005

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

Merged
merged 2 commits into from
Jun 22, 2023
Merged

Fix rfc3339 datetime migration #1005

merged 2 commits into from
Jun 22, 2023

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Jun 22, 2023

Content

This PR fix the migration that migrate dates in the aggregator database to the rfc 3339 format.
The created_at & artifact columns of the signed_entity table were swapped, leading to an error when querying any artifacts.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Issue(s)

Relates to #946, Fix a bug introduced in #994

The `created_at` & `artifact` columns of the `signed_entity` table were
swapped, leading to an error when querying any artifacts.
@Alenar Alenar requested review from jpraynaud and ghubertpalo June 22, 2023 13:14
@Alenar
Copy link
Collaborator Author

Alenar commented Jun 22, 2023

The following script allow to visualize all dates in the database, usefull to check that they are all on the migrated to rfc3339:

select * from (select 'certificate' as 'table', 'initiated_at' as 'column', initiated_at as 'value' from certificate limit 2)
union select * from (select 'certificate', 'sealed_at', sealed_at from certificate limit 2)
union select * from (select 'open_message', 'created_at', created_at from open_message limit 1)
union select * from (select 'signer_registration', 'created_at', created_at from signer_registration limit 1)
union select * from (select 'signed_entity', 'created_at', created_at from signed_entity limit 1)
union select * from (select 'signer', 'created_at', created_at  from signer limit 1)
union select * from (select 'signer', 'updated_at', updated_at from signer limit 1)
union select * from (select 'single_signature', 'created_at', created_at from single_signature limit 1)
union select * from (select 'stake_pool', 'created_at', created_at from stake_pool limit 1)
union select * from (select 'db_version', 'updated_at', updated_at from db_version limit 1)

Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Alenar Alenar temporarily deployed to testing-preview June 22, 2023 14:57 — with GitHub Actions Inactive
@Alenar Alenar merged commit 8be00a9 into main Jun 22, 2023
@Alenar Alenar deleted the djo/946/fix_datetime_migration branch June 22, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants