Skip to content

Commit

Permalink
Update doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythicaeda committed Dec 10, 2024
1 parent eafb1c2 commit e912936
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion deployment/aerie_db_migration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Migrate the Aerie Database"""
"""Migrate the database of an Aerie venue."""

import os
import argparse
Expand Down Expand Up @@ -183,6 +183,13 @@ def add_migration_step(self, _migration_step):


def step_by_step_migration(hasura: Hasura, db_migration: DB_Migration, apply: bool):
"""
Migrate the database one migration at a time until there are no more migrations left or the user decides to quit.
:param hasura: Hasura object connected to the venue to be migrated
:param db_migration: DB_Migration containing the complete list of migrations available
:param apply: Whether to apply or revert migrations
"""
display_string = "\n\033[4mMIGRATION STEPS AVAILABLE:\033[0m\n"
_output = hasura.get_migrate_output('status')
del _output[0:3]
Expand Down Expand Up @@ -254,6 +261,12 @@ def step_by_step_migration(hasura: Hasura, db_migration: DB_Migration, apply: bo


def bulk_migration(hasura: Hasura, apply: bool):
"""
Migrate the database until there are no migrations left to be applied[reverted].
:param hasura: Hasura object connected to the venue to be migrated
:param apply: Whether to apply or revert migrations.
"""
# Migrate the database
exit_with = 0
if apply:
Expand All @@ -280,6 +293,11 @@ def bulk_migration(hasura: Hasura, apply: bool):


def migrate(args: argparse.Namespace):
"""
Handle the 'migrate' subcommand.
:param args: The arguments passed to the script.
"""
hasura = create_hasura(arguments)

clear_screen()
Expand All @@ -300,6 +318,11 @@ def migrate(args: argparse.Namespace):


def status(args: argparse.Namespace):
"""
Handle the 'status' subcommand.
:param args: The arguments passed to the script.
"""
hasura = create_hasura(args)

clear_screen()
Expand Down

0 comments on commit e912936

Please sign in to comment.