-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Schema changes example for mlos_benchd service (#931)
# Pull Request ## Title Schema changes for mlos_benchd service. ______________________________________________________________________ ## Description Schema changes for mlos_benchd service. Storage APIs to adjust these to come in a future PR. - See #732 ______________________________________________________________________ ## Type of Change - ✨ New feature ______________________________________________________________________ ## Testing Local, CI ______________________________________________________________________ ## Additional Notes (optional) @eujing have a look at the [commit history in the PR](https://github.com/microsoft/MLOS/pull/931/commits) for a sense of what's going on. This can probably be merged as is. Happy to discuss further though. ______________________________________________________________________
- Loading branch information
Showing
5 changed files
with
99 additions
and
11 deletions.
There are no files selected for viewing
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
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
56 changes: 56 additions & 0 deletions
56
...os_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# | ||
"""Adding Experiment table columns to support mlos_benchd service - See #732 | ||
Revision ID: 8928a401115b | ||
Revises: f83fb8ae7fc4 | ||
Create Date: 2025-01-14 17:06:36.181503+00:00 | ||
""" | ||
# pylint: disable=no-member | ||
|
||
from collections.abc import Sequence | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "8928a401115b" | ||
down_revision: str | None = "f83fb8ae7fc4" | ||
branch_labels: str | Sequence[str] | None = None | ||
depends_on: str | Sequence[str] | None = None | ||
|
||
|
||
def upgrade() -> None: | ||
"""The schema upgrade script for this revision.""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column("experiment", sa.Column("ts_start", sa.DateTime(), nullable=True)) | ||
op.add_column("experiment", sa.Column("ts_end", sa.DateTime(), nullable=True)) | ||
op.add_column("experiment", sa.Column("status", sa.String(length=16), nullable=True)) | ||
op.add_column( | ||
"experiment", | ||
sa.Column( | ||
"driver_name", | ||
sa.String(length=40), | ||
nullable=True, | ||
comment="Driver Host/Container Name", | ||
), | ||
) | ||
op.add_column( | ||
"experiment", | ||
sa.Column("driver_pid", sa.Integer(), nullable=True, comment="Driver Process ID"), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
"""The schema downgrade script for this revision.""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("experiment", "driver_pid") | ||
op.drop_column("experiment", "driver_name") | ||
op.drop_column("experiment", "status") | ||
op.drop_column("experiment", "ts_end") | ||
op.drop_column("experiment", "ts_start") | ||
# ### end Alembic commands ### |
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
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