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

Devtools Migrations Column type ENUM #1469

Closed
flaussinot opened this issue Aug 27, 2020 · 3 comments
Closed

Devtools Migrations Column type ENUM #1469

flaussinot opened this issue Aug 27, 2020 · 3 comments

Comments

@flaussinot
Copy link

Questions should go to https://forum.phalconphp.com
Documentation issues should go to https://github.com/phalcon/docs/issues

Expected and Actual Behavior

Describe what you are trying to achieve and what goes wrong.
I tried to implement migrations and I noticed that enum column type is generated as Column::TYPE_VARCHAR with size 1 and there is no option to change to set/enum.

Provide output if related

ERROR: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'test'

Provide minimal script to reproduce the issue

CREATE TABLE `products` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `test` enum('on','off') DEFAULT 'off',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

The model generated by webtools.php:

...
new Column(
	'test',
	[
		'type' => Column::TYPE_CHAR,
		'default' => "off",
		'size' => 1,
		'after' => 'id'
	]
)
...

Details

  • Phalcon DevTools Version: 3.4.11
  • Phalcon Framework version: 3.4.5
  • PHP Version: 7.3.14
  • Operating System: Linux CentOS
  • Server: Apache
  • Other related info (Database, table schema): MySql
@Jeckerson
Copy link
Member

ENUM type support was added since v2 phalcon/migrations. If possible, please use as separate package inside your composer.json file.

https://github.com/phalcon/migrations

@Jeckerson
Copy link
Member

Related #1464

@Jeckerson
Copy link
Member

Closing if favor of #1464

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

2 participants