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

fix(azure) add missing fields #6240

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion backend/python/plugins/azuredevops/azuredevops/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class JobResult(Enum):

@migration(20230524181430)
def add_build_id_as_job_primary_key(b: MigrationScriptBuilder):
# NOTE: We can't add a column to the primary key of an existing table
# NOTE: We can't add a column to the primary key of an existing table,
# so we have to drop the primary key constraint first,
# which is done differently in MySQL and PostgreSQL,
# and then add the new composite primary key.
Expand Down Expand Up @@ -175,3 +175,13 @@ def rename_starttime_and_finishtime_for_job(b: MigrationScriptBuilder):
def add_missing_migrations_0_17_to_0_18(b: MigrationScriptBuilder):
b.rename_column('_tool_azuredevops_gitrepositories', 'transformation_rule_id', 'scope_config_id')
b.add_column('_tool_azuredevops_gitrepositories', 'provider', 'varchar(255)')


@migration(20231013130200, name="add missing field in _tool_azuredevops_gitrepositoryconfigs")
def add_missing_field_in_tool_azuredevops_gitrepositoryconfigs(b: MigrationScriptBuilder):
b.add_column('_tool_azuredevops_gitrepositoryconfigs', 'connection_id', 'bigint')


@migration(20231013130201, name="add missing field in _tool_azuredevops_gitrepositories")
def add_missing_field_in_tool_azuredevops_gitrepositories(b: MigrationScriptBuilder):
b.add_column('_tool_azuredevops_gitrepositories', 'scope_config_id', 'bigint')
2 changes: 1 addition & 1 deletion backend/python/pydevlake/pydevlake/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def add_column(self, table: str, column: str, type: str):

def drop_column(self, table: str, column: str):
"""
Drops a column from a table if it exist.
Drops a column from a table if it exists.
"""
self.operations.append(DropColumn(table=table, column=column))

Expand Down
Loading