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

archive: don't create schema if it already exists #758

Closed
drewbanin opened this issue May 4, 2018 · 1 comment · Fixed by #1398
Closed

archive: don't create schema if it already exists #758

drewbanin opened this issue May 4, 2018 · 1 comment · Fixed by #1398
Labels
enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors! snapshots Issues related to dbt's snapshot functionality

Comments

@drewbanin
Copy link
Contributor

drewbanin commented May 4, 2018

When dbt archive is invoked, dbt will always try to create a schema for each archive using:

create schema if not exists {{ schema }};

Instead, dbt should check if the schema already exists, and skip this step if it does indeed exist. If users invoke dbt archive with a user that lacks create schema permissions, the above statement will fail even if the schema already exists! Relevant code is here: https://github.com/fishtown-analytics/dbt/blob/development/dbt/include/global_project/macros/materializations/archive/archive.sql#L113

@drewbanin
Copy link
Contributor Author

drewbanin commented Jul 5, 2018

Kicking this out of the 0.10.2 milestone. create permissions for the dbt user are generally expected by dbt. This would be a good enhancement if someone has the cycles to work on it!

@drewbanin drewbanin removed this from the 0.10.2 - Betsy Ross (unreleased) milestone Jul 5, 2018
@drewbanin drewbanin added good_first_issue Straightforward + self-contained changes, good for new contributors! snapshots Issues related to dbt's snapshot functionality labels Jul 5, 2018
@drewbanin drewbanin added this to the Wilt Chamberlain milestone Nov 28, 2018
beckjake added a commit that referenced this issue Apr 26, 2019
…reate-existing-schema

archives: do not create existing schema (#758)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors! snapshots Issues related to dbt's snapshot functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant