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

Adding IF EXISTS and IF NOT EXISTS for migrations #993

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

jwoertink
Copy link
Member

Fixes #988

This adds in the option to specify if_not_exists for the create table macro and if_exists for the alter table macro

def migrate
  create :reports, if_not_exists: true do
    # ...
  end
end

def migrate
  alter :reports, if_exists: true do
    # ...
  end
end

@jwoertink jwoertink merged commit 82eef3e into main Dec 29, 2023
9 checks passed
@jwoertink jwoertink deleted the issues/988 branch December 29, 2023 22:10
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.

Add IF EXISTS and IF NOT EXISTS options to create table
1 participant