migrations icon indicating copy to clipboard operation
migrations copied to clipboard

add set type support

Open Lucifer20211202 opened this issue 11 months ago • 1 comments

FYI I'm using mysql,the here is my DDL

CREATE TABLE `game` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `os` set('Android','iOS','Windows','Mac') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'os',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

but when I run ./vendor/bin/phalcon-migrations generate,it generate like this

...
new Column(
                    'os',
                    [
                        'type' => Column::TYPE_VARCHAR,
                        'notNull' => true,
                        'size' => 1,
                        'comment' => "os",
                        'after' => 'version'
                    ]
                ),

Lucifer20211202 avatar Feb 27 '25 17:02 Lucifer20211202

Obviously varchar and set are not equivalent

Lucifer20211202 avatar Feb 27 '25 17:02 Lucifer20211202