Skip to content

creation of table having enum columns fails #895

@MolbioUnige

Description

@MolbioUnige

At some point between version 4.6.6 and the current version, migrations of table with enum columns fails to generate the correct query.

SQLSTATE[HY000]: General error: 4161 Unknown data type: 'NOT'
Query: CREATE TABLE `documents` (`id` CHAR(36) NOT NULL, `application_id` INTEGER UNSIGNED NOT NULL, `type` NOT NULL,

The table has been defined as such:

$this->table('documents')
            ->addColumn('id', 'uuid', [
                'default' => null,
                'limit' => null,
                'null' => false,
            ])
            ->addPrimaryKey(['id'])
            ->addColumn('application_id', 'integer', [
                'default' => null,
                'limit' => 10,
                'null' => false,
                'signed' => false,
            ])
            ->addColumn('type', 'enum', [
                'default' => null,
                'limit' => null,
                'null' => false,
                'values' => ['BSc','MSc','GRE','CV'],
            ])....

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions