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

feat: Table Column Defaults #631

Merged
merged 8 commits into from
Aug 11, 2021

Conversation

robbruce
Copy link
Contributor

@robbruce robbruce commented Aug 3, 2021

Add support for column defaults on the snowflake_table resource. Note there are some limitations:

  • ALTER TABLE MODIFY COLUMN does not support adding a default; unless a sequence has been used originally as the default and a new sequence is being used
  • ALTER TABLE ADD COLUMN only supports setting a column default to a constant value

Test Plan

  • acceptance tests
  • unit tests
  • ran make docs

References

@robbruce robbruce requested a review from a team as a code owner August 3, 2021 08:30
@robbruce robbruce requested a review from edulop91 August 3, 2021 08:30
@alldoami
Copy link
Contributor

alldoami commented Aug 3, 2021

/ok-to-test sha=a654ce1

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

Integration tests failure for a654ce1

@robbruce
Copy link
Contributor Author

robbruce commented Aug 3, 2021

@alldoami - I've corrected the failed TestSequenceRead unit test; some of the other unit tests I can't run locally just to account level conflicts we already have enabled, e.g. SCIM.

@alldoami
Copy link
Contributor

alldoami commented Aug 3, 2021

/ok-to-test sha=85a1a43

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

Integration tests failure for 85a1a43

@alldoami
Copy link
Contributor

alldoami commented Aug 3, 2021

Looks like there is a panic: runtime error: invalid memory address or nil pointer dereference in the TestAcc_Table test

@robbruce
Copy link
Contributor Author

robbruce commented Aug 3, 2021

@alldoami - sorted. I hadn't correctly accounted for new columns being added without a default value 🤦 . Working now

$ TF_ACC=1 go test -v ./... -run TestAcc_Table
?   	github.com/chanzuckerberg/terraform-provider-snowflake	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/chanzuckerberg/terraform-provider-snowflake/pkg/datasources	(cached) [no tests to run]
?   	github.com/chanzuckerberg/terraform-provider-snowflake/pkg/db	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/chanzuckerberg/terraform-provider-snowflake/pkg/provider	(cached) [no tests to run]
=== RUN   TestAcc_Table
=== PAUSE TestAcc_Table
=== RUN   TestAcc_TableDefaults
=== PAUSE TestAcc_TableDefaults
=== CONT  TestAcc_Table
=== CONT  TestAcc_TableDefaults
--- PASS: TestAcc_TableDefaults (11.76s)
--- PASS: TestAcc_Table (59.63s)
PASS
ok  	github.com/chanzuckerberg/terraform-provider-snowflake/pkg/resources	59.982s
testing: warning: no tests to run
PASS
ok  	github.com/chanzuckerberg/terraform-provider-snowflake/pkg/snowflake	(cached) [no tests to run]
?   	github.com/chanzuckerberg/terraform-provider-snowflake/pkg/testhelpers	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/chanzuckerberg/terraform-provider-snowflake/pkg/validation	(cached) [no tests to run]
?   	github.com/chanzuckerberg/terraform-provider-snowflake/pkg/version	[no test files]

@alldoami
Copy link
Contributor

alldoami commented Aug 3, 2021

/ok-to-test sha=0ef8734

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

Integration tests failure for 0ef8734

@robbruce
Copy link
Contributor Author

robbruce commented Aug 3, 2021

@alldoami - anything in the logs to suggest what else needs correcting?

@robbruce robbruce requested a review from alldoami August 6, 2021 16:41
@alldoami
Copy link
Contributor

/ok-to-test sha=8fc3a2b

@github-actions
Copy link

Integration tests success for 8fc3a2b

@alldoami alldoami merged commit bcda1d9 into Snowflake-Labs:main Aug 11, 2021
jtzero pushed a commit to rxrevu/terraform-provider-snowflake that referenced this pull request Aug 19, 2021
anton-chekanov pushed a commit to anton-chekanov/terraform-provider-snowflake that referenced this pull request Jan 25, 2022
daniepett pushed a commit to daniepett/terraform-provider-snowflake that referenced this pull request Feb 9, 2022
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