Skip to content

Commit

Permalink
OCT-1576 & OCT-1492: Fix altering migrations (#236)
Browse files Browse the repository at this point in the history
## Description

## Definition of Done

1. [ ] Acceptance criteria are met.
2. [ ] PR is manually tested before the merge by developer(s).
    - [ ] Happy path is manually checked.
3. [ ] PR is manually tested by QA when their assistance is required
(1).
- [ ] Octant Areas & Test Cases are checked for impact and updated if
required (2).
4. [ ] Unit tests are added unless there is a reason to omit them.
5. [ ] Automated tests are added when required.
6. [ ] The code is merged.
7. [ ] Tech documentation is added / updated, reviewed and approved
(including mandatory approval by a code owner, should such exist for
changed files).
    - [ ] BE: Swagger documentation is updated.
8. [ ] When required by QA:
    - [ ] Deployed to the relevant environment.
    - [ ] Passed system tests.

---

(1) Developer(s) in coordination with QA decide whether it's required.
For small tickets introducing small changes QA assistance is most
probably not required.

(2) [Octant Areas & Test
Cases](https://docs.google.com/spreadsheets/d/1cRe6dxuKJV3a4ZskAwWEPvrFkQm6rEfyUCYwLTYw_Cc).
  • Loading branch information
kgarbacinski authored Jun 5, 2024
1 parent 1bbfe9e commit cf5c5a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@

def upgrade():
with op.batch_alter_table("allocations", schema=None) as batch_op:
batch_op.add_column(
sa.Column("project_address", sa.String(length=42), nullable=False)
)
batch_op.drop_column("proposal_address")
batch_op.alter_column("proposal_address", new_column_name="project_address")


def downgrade():
with op.batch_alter_table("allocations", schema=None) as batch_op:
batch_op.add_column(
sa.Column("proposal_address", sa.VARCHAR(length=42), nullable=False)
)
batch_op.drop_column("project_address")
batch_op.alter_column("project_address", new_column_name="proposal_address")
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

def upgrade():
with op.batch_alter_table("pending_epoch_snapshots", schema=None) as batch_op:
batch_op.add_column(
sa.Column("vanilla_individual_rewards", sa.String(), nullable=False)
batch_op.alter_column(
column_name="all_individual_rewards",
new_column_name="vanilla_individual_rewards",
)
batch_op.drop_column("all_individual_rewards")


def downgrade():
with op.batch_alter_table("pending_epoch_snapshots", schema=None) as batch_op:
batch_op.add_column(
sa.Column("all_individual_rewards", sa.VARCHAR(), nullable=False)
batch_op.alter_column(
column_name="vanilla_individual_rewards",
new_column_name="all_individual_rewards",
)
batch_op.drop_column("vanilla_individual_rewards")

0 comments on commit cf5c5a5

Please sign in to comment.