Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: xataio/pgroll
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.11.0
Choose a base ref
...
head repository: xataio/pgroll
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.11.1
Choose a head ref
  • 3 commits
  • 24 files changed
  • 2 contributors

Commits on Apr 11, 2025

  1. Add JSON docs back with tabs (#787)

    Method:
    
    vscode find and replace regex:
    ![Screenshot 2025-04-10 at 16 01
    57@2x](https://github.com/user-attachments/assets/aba4685e-a1e1-4e28-9663-6308a06dc53d)
    
    Copied and pasted from the red diffs:
    https://github.com/xataio/pgroll/pull/773/files
    
    AI'd updown.mdx
    
    Check the preview link for a demo
    richardgill authored Apr 11, 2025
    Configuration menu
    Copy the full SHA
    95d8794 View commit details
    Browse the repository at this point in the history
  2. Pass all column attributes to new temporary column when adding a new …

    …one to the table (#788)
    
    The following migration was failing due to several reasons:
    
    ```json
    {
      "operations": [
        {
          "create_table": {
            "name": "users",
            "columns": [
              {
                "name": "id",
                "type": "uuid",
                "pk": true
              }
            ]
          }
        },
        {
          "add_column": {
            "table": "users",
            "column": {
              "name": "name",
              "type": "text",
              "nullable": true
            }
          }
        },
        {
          "create_constraint": {
            "table": "users",
            "columns": [
              "name"
            ],
            "type": "unique",
            "name": "my_custom_name",
            "up": {
              "name": "name"
            },
            "down": {
              "name": "name"
            }
          }
        }
      ]
    }
    ```
    
    This PR fixes the first problem with the migration. The first problem is
    when `pgroll` adds the new column with the temporary name to the table
    schema it lacks all column attributes. Thus, if a later operation tries
    to duplicate this duplicated column it fails because we do not know the
    type of the column, the default value, etc. The SQL statement generated
    has a syntax error because of the lack of information:
    
    ```
    Failed to start migration: unable to execute start operation: failed to duplicate column: pq: syntax error at or near ","
    ```
    kvch authored Apr 11, 2025
    Configuration menu
    Copy the full SHA
    08c7e01 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2025

  1. Add missing attributes to column info in virtual schema (#789)

    When a table was added, `pgroll` did not store all required column
    metadata. Default values and comments were missing from columns. So when
    `pgroll` tried to duplicate the column, these got lost.
    
    Example to reproduce the issue:
    ```json
    {
        "operations": [
            {
                "create_table": {
                    "name": "useres",
                    "comment": "my_comment",
                    "columns": [
                        {
                            "name": "id",
                            "type": "uuid",
                            "pk": true,
                            "nullable": false,
                            "default": "gen_random_uuid()",
                            "comment": "my_comment"
                        }
                    ]
                }
            },
            {
                "create_constraint": {
                    "table": "users",
                    "columns": ["id"],
                    "type": "unique",
                    "name": "my_unique",
                    "up": {
                        "id": "id"
                    },
                    "down": {
                        "id": "id"
                    }
                }
            }
        ]
    }
    ```
    kvch authored Apr 14, 2025
    Configuration menu
    Copy the full SHA
    3922f45 View commit details
    Browse the repository at this point in the history
Loading