I'm trying to add a column via migration to a particular table. The goal is to add a column type of an array that include enum values
1 Attempt:
await queryInterface.addColumn(
'Locations',
'tags',
{
type: Sequelize.ARRAY(Sequelize.ENUM({
values: ['Competitor', 'Multi Location', 'Duplicate']
})),
}
);
Result: ERROR: type "public.enum_Locations_tags[]" does not exist
2 Attempt:
await queryInterface.sequelize.query("CREATE TYPE enum_Locations_tags AS ENUM ('Competitor', 'Multi Location', 'Duplicate');");
await queryInterface.addColumn(
'Locations',
'tags',
{
type: Sequelize.ARRAY(Sequelize.ENUM({
values: ['Competitor', 'Multi Location', 'Duplicate']
})),
}
);
Result: ERROR: type "public.enum_Locations_tags[]" does not exist
Any idea how to solve this Thanks in advance!