Skip to content

Migrations that add and drop columns creates syntax error #18

@sc68cal

Description

@sc68cal

This is with 598b491 and I haven't checked to see if this is present in the released version.

pub fn up(repo: anytype) !void {
    try repo.alterTable(
        "locations",
        .{
            .columns = .{
                .add = &.{
                    t.column("lat", .float, .{}),
                    t.column("lon", .float, .{}),
                },
                .drop = &.{
                    "state",
                    "zip",
                },
            },
        },
    );
}
/
| Query:
|   ALTER TABLE "locations" ADD COLUMN "lat" REAL NOT NULL, ADD COLUMN "lon" REAL NOT NULL DROP COLUMN "state", DROP COLUMN "zip"
| Error:
|   PG: syntax error at or near "DROP"
\

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions