Craft-Migration-Manager icon indicating copy to clipboard operation
Craft-Migration-Manager copied to clipboard

Content Migration failing on matrixblocktypes, Postgres

Open scottalankrieger opened this issue 8 years ago • 5 comments

I have a new craft install with a Postgres database. The content migration includes a matrix field. When I run the migration I get this error:

Exception: SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for integer: "f"
The SQL being executed was: SELECT EXISTS(SELECT *
FROM "matrixblocktypes"
WHERE ("matrixblocktypes"."name"='Default') AND ("matrixblocktypes"."fieldId"=FALSE)) 

The matrixblocktypes table is currently empty. If I remove the matrix field from the migration, everything else works fine.

Running the SELECT in Postgres returns this error:

SELECT EXISTS(
SELECT *
FROM "matrixblocktypes"
WHERE ("matrixblocktypes"."name"='Default') 
AND 
("matrixblocktypes"."fieldId"=FALSE)
)
ERROR:  operator does not exist: integer = boolean
LINE 6: ("matrixblocktypes"."fieldId"=FALSE)
                                     ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts. (Line 7)

scottalankrieger avatar Nov 21 '18 15:11 scottalankrieger

Perhaps this is related? https://github.com/Firstborn/Craft-Migration-Manager/pull/31

scottalankrieger avatar Nov 21 '18 15:11 scottalankrieger

#31 should only go into effect on new fields, there shouldn't be any selects happening after that?

AlexandreKilian avatar Nov 29 '18 14:11 AlexandreKilian

I'm not running Postgres to test this but it seems odd that Postgres would throw an error when selecting from an empty table. The Migration Manager is using core Craft functions to retrieve matrix data.

dgrigg avatar Nov 29 '18 14:11 dgrigg

@ScottKriegerPD have you upgraded your Craft install lately, there have been some Postgres updates that may resolve this.

dgrigg avatar Jan 29 '19 01:01 dgrigg

I wound up back with MySQL. Not sure if this resolved, but I'll close. Thanks.

scottalankrieger avatar Jan 31 '19 22:01 scottalankrieger