Switch Enum from native type to string or text

Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
This commit is contained in:
derrickmehaffy 2021-12-09 12:31:52 -07:00
parent 073f279e91
commit e16bf9b259
3 changed files with 3 additions and 12 deletions

View File

@ -63,7 +63,7 @@ const toStrapiType = column => {
return { type: 'bigInteger' };
}
case 'enum': {
return { type: 'enum' };
return { type: 'string' };
}
case 'tinyint': {
return { type: 'boolean' };

View File

@ -34,7 +34,6 @@ class SqliteDialect extends Dialect {
getSqlType(type) {
switch (type) {
// FIXME: enum must be dealt separately
case 'enum': {
return 'text';
}

View File

@ -113,7 +113,8 @@ const getColumnType = attribute => {
// We might want to convert email/password to string types before going into the orm with specific validators & transformers
case 'password':
case 'email':
case 'string': {
case 'string':
case 'enumeration': {
return { type: 'string' };
}
case 'uid': {
@ -132,15 +133,6 @@ const getColumnType = attribute => {
case 'json': {
return { type: 'jsonb' };
}
case 'enumeration': {
return {
type: 'enum',
args: [
attribute.enum,
/*,{ useNative: true, existingType: true, enumName: 'foo_type', schemaName: 'public' }*/
],
};
}
case 'integer': {
return { type: 'integer' };
}