Skip to content

Add missing attributes to column info in virtual schema #789

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

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Apr 11, 2025

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:

{
    "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"
                }
            }
        }
    ]
}

@github-actions github-actions bot temporarily deployed to Docs Preview April 11, 2025 15:49 Inactive
@github-actions github-actions bot temporarily deployed to Docs Preview April 14, 2025 11:41 Inactive
@kvch kvch marked this pull request as ready for review April 14, 2025 11:41
@kvch kvch enabled auto-merge (squash) April 14, 2025 11:42
@kvch kvch merged commit 3922f45 into xataio:main Apr 14, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants