-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refine migration script #1617
Open
Mythicaeda
wants to merge
13
commits into
develop
Choose a base branch
from
fix/refine-migration-script
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refine migration script #1617
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mythicaeda
added
refactor
A code change that neither fixes a bug nor adds a feature
fix
A bug fix
labels
Dec 9, 2024
This view allows Aerie admin users to read migration information about their venue (information was formerly locked to Hasura/Postgres Admins)
Additionally, record where the migration steps are located and update step-by-step mode to reference this location
Hasura CLI loads first from arguments passed to the command, then from environment variables, then from a passed .env, then finally from a config file. This change updates how the script determines its connection credentials to match how HasuraCLI works.
Changes the script to use a `run_sql` request to get the current migration, rather than a direct connection to a database. This removes the ability for the user to specify one database in the 'netloc' argument and another in the Hasura configuration
Hasura replaces the os.system and subprocess.getoutput calls. This was done as there are three flags that need to be provided to every call to the hasura cli: - skip-update-check: cleans up the output by skipping the automatic update check - project: directory where the cli command is executed - envfile: env file to load envvars from. Set to '.env' in the directory the CLI is run from to avoid the CLI and the Migration script loading separate envfiles
- Extracts initializing a Hasura object from a Namespace into a function - moves migration logic into 'migrate' subfunction
Mythicaeda
force-pushed
the
fix/refine-migration-script
branch
from
December 10, 2024 15:17
2c68885
to
174f6b3
Compare
The migration script now runs "hasura metadata apply" before "hasura metadata reload". - As metadata reloading takes noticeably longer, in step-by-step mode it now only runs when exiting, rather than between each step.
Mythicaeda
added
the
breaking change
A change that will require updating downstream code
label
Dec 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
A change that will require updating downstream code
fix
A bug fix
refactor
A code change that neither fixes a bug nor adds a feature
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a tracked view to Hasura showing the integer contents of the
migrations.schema_migrations
table. This allows Aerie Admins on a venue to view which migrations have been applied (was formerly locked behind Hasura Admins/Postgres Admins).Heavily refactors the Aerie DB Migration Script:
run_sql
query against the Hasura venue, removing the need to provide database connection informationVerification
Manually tested
Documentation
Added doc comments and type hints throughout the script.
The website docs were edited to reflect the changes to the command line arguments and introduction of subcommands.
Future work