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

Convert SET DATA TYPE SQL to pgroll operation #506

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

andrew-farries
Copy link
Collaborator

@andrew-farries andrew-farries commented Dec 3, 2024

Convert SQL statements of the form:

ALTER TABLE foo ALTER COLUMN a [SET DATA] TYPE text

to the equivalent pgroll migration:

[
  {
    "alter_column": {
      "column": "a",
      "down": "TODO: Implement SQL data migration",
      "table": "foo",
      "type": "text",
      "up": "TODO: Implement SQL data migration"
    }
  }
]

Part of #504

Convert SQL statements of the form:

```sql
ALTER TABLE foo ALTER COLUMN a [SET DATA] TYPE text
```

to the equivalent `pgroll` migration:

```json
[
  {
    "alter_column": {
      "column": "a",
      "down": "TODO: Implement SQL data migration",
      "table": "foo",
      "type": "text",
      "up": "TODO: Implement SQL data migration"
    }
  }
]
```
@andrew-farries andrew-farries marked this pull request as ready for review December 3, 2024 13:00
@andrew-farries andrew-farries merged commit c756988 into main Dec 3, 2024
27 checks passed
@andrew-farries andrew-farries deleted the sql2pgroll-alter-column-type branch December 3, 2024 14:25
@andrew-farries andrew-farries added the sql2pgroll Issues relating to the sql2pgroll package label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql2pgroll Issues relating to the sql2pgroll package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants