Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation failed because of the DB migration #44

Closed
nflorentin opened this issue Mar 25, 2020 · 3 comments
Closed

Installation failed because of the DB migration #44

nflorentin opened this issue Mar 25, 2020 · 3 comments
Assignees
Labels
bug 🕷 Something isn't working

Comments

@nflorentin
Copy link

Hi,

First, thanks you for your work on this plugin.

The installation of the plugin fails because of an error during installation (running ./craft install/plugin navigate command).

I got the following error:

create table {{%navigate_nodes}} ...Exception: SQLSTATE[42804]: Datatype mismatch: 7
ERROR:  column "enabled" is of type boolean but default expression is of type integer
HINT:  You will need to rewrite or cast the expression.
The SQL being executed was: CREATE TABLE "navigate_nodes" (
	"id" serial NOT NULL PRIMARY KEY,
	"siteId" integer NOT NULL,
	"navId" integer NOT NULL,
	"name" varchar(255) NOT NULL,
	"url" varchar(255),
	"elementId" integer,
	"elementType" varchar(20),
	"type" varchar(20),
	"enabled" boolean DEFAULT 1,
	"blank" boolean DEFAULT 0,
	"classes" varchar(255),
	"parent" integer DEFAULT 0,
	"order" integer,
	"dateCreated" timestamp(0) NOT NULL,
	"dateUpdated" timestamp(0) NOT NULL,
	"uid" char(36) NOT NULL DEFAULT '0'
)

I think the migration works for MySQL but not for Postgresql. Boolean columns in postgres only accepts the following values: "t", "f", "true", "false", "y", "n", "yes", "no", "1", "0".

I don't know Craft nor Yii very well but replacing $this->boolean()->defaultValue(1) by $this->boolean()->defaultValue(true) in the Install.php file could perhaps do the trick ?

Thanks in advance for your help!

Craft version: Craft Pro 3.4.9
Postgresql: 11.3

@janhenckens
Copy link
Member

Hey @nflorentin, thanks for reporting that. I haven't tested with Postgresql so that's probably the issue.
I'll try to get an update out by this evening!

@janhenckens janhenckens self-assigned this Mar 25, 2020
@janhenckens janhenckens added the bug 🕷 Something isn't working label Mar 25, 2020
@janhenckens
Copy link
Member

Fixed in 2.5.2. Could you update and give it another try? Thanks!

@nflorentin
Copy link
Author

Hi Janhenckens!
Thanks you for your reactivity. It is now working well 👍.
Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🕷 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants