Skip to content

Migration Type for ID field #2

@VinayakBagaria

Description

@VinayakBagaria

Shouldn't the migration for ID field be varchar explicitly?

After running the migration, Postgres defaulted to integer PK field. When I was inserting a rocket with string ID, it gave me an error saying the type didn't match.

Updated my migration after which the whole flow worked.

CREATE TABLE IF NOT EXISTS rockets(
    id varchar(128) NOT NULL PRIMARY KEY,
    name varchar(50),
    type varchar(50)
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions