Skip to content

Migration fails on PostgreSQL - type "blob" does not exist #170

@ilveroluca

Description

@ilveroluca

I'm trying to deploy the most recent version (6.8) with a PostgreSQL 18 back end. As the application starts, it runs the migrations, but these fail. The database logs:

ERROR:  type "blob" does not exist at character 503
STATEMENT:  CREATE TABLE "public"."recipes" ("id" INT NOT NULL GENERATED BY DEFAULT AS IDENTITY, "name" VARCHAR(128) NOT NULL, "ethnicity_id" INT DEFAULT NULL, "base_type_id" INT DEFAULT NULL, "course_id" INT DEFAULT NULL, "preparation_time_id" INT DEFAULT NULL, "difficulty_id" INT DEFAULT NULL, "serving_size" INT DEFAULT NULL, "directions" TEXT DEFAULT NULL, "comments" TEXT DEFAULT NULL, "source_description" VARCHAR(200) DEFAULT NULL, "recipe_cost" FLOAT DEFAULT NULL, "modified" DATE DEFAULT NULL, "picture" BLOB DEFAULT NULL, "picture_type" VARCHAR(32) DEFAULT NULL, "private" BOOLEAN NOT NULL, "system" VARCHAR(16) NOT NULL DEFAULT 'usa', "source_id" INT DEFAULT NULL, "user_id" INT DEFAULT NULL, "preparation_method_id" INT DEFAULT NULL, CONSTRAINT "recipes_pkey" PRIMARY KEY ("id"));

"blob" is a MySQL type; with PgSQL, one should use "bytea". I thought CakePHP should abstract these type variations across different databases. Might the type name be hard-coded somewhere? E.g.,

config/Migrations/20210101154551_Initial.php
365:            ->addColumn('picture', 'blob', [
460:            ->addColumn('picture', 'blob', [

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions