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

Automatic database upgrades #7166

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

zachliu
Copy link
Contributor

@zachliu zachliu commented Sep 18, 2024

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

Automatically upgrade the database upon services start-up. So that we don't need to do it manually using cli tools on the server. #7167 has to go in first because upgrading db takes time. The rest of the program has to wait for it to finish.

I started the discussion #7005 on automated db migration mechanisms.

Further discussing: #7161 (comment)

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

@@ -42,6 +42,10 @@ dev_worker() {
}

server() {
echo "Upgrading database..."

Copy link
Member

Choose a reason for hiding this comment

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

Probably doesn't need the blank line between the echo and the manage.py command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is one blank line between echo and exec in scheduler(), dev_scheduler(), worker(), dev_worker(). thought I should just keep up with the neighbors to be consistent 😁

Copy link
Member

@justinclift justinclift Sep 21, 2024

Choose a reason for hiding this comment

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

Oops, my bad. 🤦

Yeah, copying the existing style is the right approach. 😄

Copy link
Member

@justinclift justinclift Sep 21, 2024

Choose a reason for hiding this comment

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

Timing wise, @arikfr is working on a patch to fix the generation of query hashes, and I think might also be adjusting one of the migrations so it takes the auto limit into account as well.

That should turn up in the next few days hopefully, and I'd personally like for us to get that in before this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

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.

2 participants