kamihi.cli.commands.db
⚓︎
Database management module for Kamihi CLI.
License
MIT
Functions:
| Name | Description |
|---|---|
downgrade |
Downgrade the database to an earlier version. |
main |
Database management commands for Kamihi CLI. |
migrate |
Run database migrations. |
revision_callback |
Ensure the revision value is valid. |
upgrade |
Upgrade the database to a later version. |
downgrade
⚓︎
downgrade(
ctx: Context,
revision: Annotated[
str,
Option(
--revision,
-r,
help="The revision to downgrade to.",
show_default=-1,
callback=revision_callback,
),
] = "-1",
) -> None
Downgrade the database to an earlier version.
Source code in src/kamihi/cli/commands/db.py
84 85 86 87 88 89 90 91 92 93 94 95 96 | |
main
⚓︎
main(ctx: Context) -> None
Database management commands for Kamihi CLI.
Source code in src/kamihi/cli/commands/db.py
46 47 48 49 50 51 52 53 54 55 56 57 58 | |
migrate
⚓︎
migrate(ctx: Context) -> None
Run database migrations.
Source code in src/kamihi/cli/commands/db.py
61 62 63 64 65 66 | |
revision_callback
⚓︎
revision_callback(ctx: Context, value: str) -> str
Ensure the revision value is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Context
|
The Typer context. |
required |
|
str
|
The revision value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The validated revision value. |
Source code in src/kamihi/cli/commands/db.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
upgrade
⚓︎
upgrade(
ctx: Context,
revision: Annotated[
str,
Option(
--revision,
-r,
help="The revision to upgrade to.",
show_default=head,
callback=revision_callback,
),
] = "head",
) -> None
Upgrade the database to a later version.
Source code in src/kamihi/cli/commands/db.py
69 70 71 72 73 74 75 76 77 78 79 80 81 | |