dgrigg / Craft-Migration-Manager

Deprecated - Migration Manager for Craft CMS
MIT License
39 stars 15 forks source link

Content Migration failing on matrixblocktypes, Postgres #39

Closed scottalankrieger closed 5 years ago

scottalankrieger commented 5 years ago

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 commented 5 years ago

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

AlexandreKilian commented 5 years ago

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

dgrigg commented 5 years ago

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 commented 5 years ago

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

scottalankrieger commented 5 years ago

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