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

Unable to alter more than one column in the same alter statement #8

Open
jameswilddev opened this issue Jun 23, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jameswilddev
Copy link
Collaborator

This works:

    migrate() {
        this.alter('site_map_pages', blueprint => {
            blueprint.integer('width').required().default(0);
        });
    }

    // In another migration...

    migrate() {
        this.alter('site_map_pages', blueprint => {
            blueprint.integer('height').required().default(0);
        });
    }

This doesn't (only the width column is added):

    migrate() {
        this.alter('site_map_pages', blueprint => {
            blueprint.integer('width').required().default(0);
            blueprint.integer('height').required().default(0);
        });
    }

It looks like under the hood this generates a single string with multiple ALTER TABLE statements in it which probably isn't supported.

@jameswilddev jameswilddev added the bug Something isn't working label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant