Skip to content

Conversation

@tianzhou
Copy link
Contributor

Fix #86

Copilot AI review requested due to automatic review settings October 15, 2025 17:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #86 by allowing NOT NULL constraints to be applied to generated columns in PostgreSQL schema generation. The fix modifies the column clause building logic to remove the exclusion of generated columns from NOT NULL constraint generation.

  • Removes the condition that prevented NOT NULL constraints on generated columns
  • Updates test data to include a new generated column with NOT NULL constraint

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/diff/table.go Modified buildColumnClauses to allow NOT NULL on generated columns
testdata/diff/create_table/add_column_generated/plan.txt Added test case for generated column with NOT NULL
testdata/diff/create_table/add_column_generated/plan.sql Added SQL for generated column with NOT NULL
testdata/diff/create_table/add_column_generated/plan.json Added JSON plan entry for generated column with NOT NULL
testdata/diff/create_table/add_column_generated/new.sql Added generated column definition with NOT NULL
testdata/diff/create_table/add_column_generated/diff.sql Added ALTER statement for generated column with NOT NULL

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tianzhou tianzhou merged commit 133ea52 into main Oct 15, 2025
2 checks passed
@tianzhou tianzhou deleted the generated_column_not_null branch October 23, 2025 06:34
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.

Generated columns with NOT NULL constraint are not preserved

1 participant