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

2.3/develop ENUM “unknown database type enum requested” #2916

Closed
brignoni opened this issue Aug 7, 2013 · 17 comments
Closed

2.3/develop ENUM “unknown database type enum requested” #2916

brignoni opened this issue Aug 7, 2013 · 17 comments

Comments

@brignoni
Copy link
Contributor

brignoni commented Aug 7, 2013

@philsturgeon, @jerel, @adamfairholm, @RyanThompson,

This issue really needs your help. This can be a real show stopper.

I tried working around this issue. I thought I had fixed in this commit but it has no effect on the schema builder.
https://github.com/obrignoni/pyrocms/commit/31208a3f4c70e023281d4c0ad03f2fb66d471f5b

When using the MySQL driver, whenever we want to interact with a table using the schema builder we'll get this error if that table has an ENUM column. Like for example we have the "gender" ENUM column on the profiles table that we want to convert to a stream. When you use schema->hasColumn() or try to add columns using schema->table() you'll get the error.

I believe I can work around some things by adding columns with statements. But if we want to replace dbforge and rely entirely on the schema builder, we need to resolve this or talk to the vendors to see if they can provide a solution.

Here are some similar issues for reference.

I'll appreciate any help I can get.

Thanks

@brignoni
Copy link
Contributor Author

brignoni commented Aug 7, 2013

Or another option would be to convert all ENUM columns to string or boolean accordingly and not use ENUM at all.

@adamfairholm
Copy link

It sounds like ENUM is the best way to go here. To the best of my knowledge, streams does not try to create any ENUM columns, but it does, as you point out, need to convert some tables that use ENUM.

I guess we just need a migration for this.

@brignoni
Copy link
Contributor Author

brignoni commented Aug 7, 2013

Thanks for the quick response.

Ok, I will make a migration to replace all ENUM types that exist in Pyro.

@philsturgeon
Copy link
Member

WAIT. enum is nice at times. Is this only converting enum for streams tables?

Sent from my iPhone

On Aug 6, 2013, at 9:29 PM, Osvaldo Brignoni notifications@github.com wrote:

Thanks for the quick response.

Ok, I will make a migration to replace all ENUM types that exist in Pyro.


Reply to this email directly or view it on GitHub.

@adamfairholm
Copy link

I don't believe streams ever uses enum.

@philsturgeon
Copy link
Member

I mean, are we adding code that will convert enum to something else when a table is converted to streams, or removing all enums from pyro? Because if its the latter: fuck that.

Sent from my iPhone

On Aug 6, 2013, at 10:15 PM, Adam Fairholm notifications@github.com wrote:

I don't believe streams ever uses enum.


Reply to this email directly or view it on GitHub.

@brignoni
Copy link
Contributor Author

brignoni commented Aug 7, 2013

ok, I found a simpler solution. I'm not going to replace the enums. Converting a table to a stream works ok with dbforge in a migration but not a new CMS install.

So for a new CMS install, I will drop the profiles table and create a new stream and add the fields. That should work.

@RyanThompson
Copy link
Member

Streams does not, correct.
Ryan Thompson
President / CEO
AI Web Systems, Inc.
(877) 705-0806
www.aiwebsystems.com (http://aiwebsystems.com/)
---- Original Message ----
From: Adam Fairholm
To: "pyrocms/pyrocms"
Cc: "Ryan Thompson"
Sent: Tue, Aug 6, 2013, 9:16 PM
Subject: Re: [pyrocms] 2.3/develop ENUM “unknown database type enum
requested” (#2916)
I don't believe streams ever uses enum.

—

Reply to this email directly or view it on GitHub.

@philsturgeon
Copy link
Member

Please halt all action on this until I can review the problem.

Sent from my iPhone

On Aug 6, 2013, at 10:35 PM, Osvaldo Brignoni notifications@github.com wrote:

ok, I found a simpler solution. I'm not going to replace the enums. Converting a table to a stream works ok with dbforge in a migration but not a new CMS install.

So for a new CMS install, I will drop the profiles table and create a new stream and add the fields. That should work.


Reply to this email directly or view it on GitHub.

@RyanThompson
Copy link
Member

Profiles / Users should be created in the install method of the module.
That code needs to be pulled out of the install_m model. Install all
modules applicable THEN add the initial user and the profile entry.
Ryan Thompson
President / CEO
AI Web Systems, Inc.
(877) 705-0806
www.aiwebsystems.com (http://aiwebsystems.com/)
---- Original Message ----
From: Osvaldo Brignoni
To: "pyrocms/pyrocms"
Cc: "Ryan Thompson"
Sent: Tue, Aug 6, 2013, 9:35 PM
Subject: Re: [pyrocms] 2.3/develop ENUM “unknown database type enum
requested” (#2916)
ok, I found a simpler solution. I'm not going to replace the enums.
Converting a table to a stream works ok with dbforge in a migration but not
a new CMS install.

So for a new CMS install, I will drop the profiles table and create a new

stream and add the fields. That should work.

—

Reply to this email directly or view it on GitHub.

@brignoni
Copy link
Contributor Author

brignoni commented Aug 7, 2013

Holding on ;-)

@brignoni
Copy link
Contributor Author

brignoni commented Aug 7, 2013

@RyanThompson that makes sense.

@brignoni
Copy link
Contributor Author

brignoni commented Aug 7, 2013

Alright, although enum issue is there, we managed to fix the profiles install. Thanks for the help

@philsturgeon
Copy link
Member

Sounds like this fixed?

@RyanThompson
Copy link
Member

Yap

Sent from my iPhone

On Sep 12, 2013, at 6:25 PM, Phil Sturgeon notifications@github.com wrote:

Sounds like this fixed?


Reply to this email directly or view it on GitHub.

@brignoni
Copy link
Contributor Author

The enum issue with hasColumn is still present. I only use it in cases where I want to avoid an error when trying to create a column that already exists.

We can get around these situations by wrapping our schema logic in a try / catch block to suppress errors and allow the installer and other things to continue.

@philsturgeon
Copy link
Member

Yeah I've done the trp/catch approach in the past. It's an issue with DBAL which hopefully some day they'll fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants