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

Primary Key columns are updated to nullable after initial apply #1248

Open
chasegiles-built opened this issue Sep 30, 2022 · 0 comments
Open
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:table Issue connected to the snowflake_table resource

Comments

@chasegiles-built
Copy link
Contributor

Provider Version

0.40

Terraform Version

0.15.5

Describe the bug

Columns that are a part of the primary key are correctly created with NOT NULL. On the next apply, if you do no explicitly define nullable in the column definition, Terraform will update these columns to NULL.

Expected behavior

Although the default of a column nullable is true, I would expect Terraform to account for columns defined in the primary key and consider those to be false by default.

Code samples and commands

Running terraform plan displays the change.

Mocked up structure that represents our scenario:

resource "snowflake_table" "table" {

  database = "DATABASE"
  schema   = "SCHEMA"
  name     = "TABLE"

  # column that is part of the primary key
  column {
    name = "key"
    type = "NUMBER"
  }

  # additional column
  column {
    name = "c1"
    type = "NUMBER"
  }

}

Terraform will create the table on the first apply and the key column will have NOT NULL.

The next apply will result in:

~ nullable = false -> true
@chasegiles-built chasegiles-built added the bug Used to mark issues with provider's incorrect behavior label Sep 30, 2022
@sfc-gh-jcieslak sfc-gh-jcieslak added category:resource resource:table Issue connected to the snowflake_table resource labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:table Issue connected to the snowflake_table resource
Projects
None yet
Development

No branches or pull requests

2 participants