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' }; return { type: 'bigInteger' };
} }
case 'enum': { case 'enum': {
return { type: 'enum' }; return { type: 'string' };
} }
case 'tinyint': { case 'tinyint': {
return { type: 'boolean' }; return { type: 'boolean' };

View File

@ -34,7 +34,6 @@ class SqliteDialect extends Dialect {
getSqlType(type) { getSqlType(type) {
switch (type) { switch (type) {
// FIXME: enum must be dealt separately
case 'enum': { case 'enum': {
return 'text'; 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 // We might want to convert email/password to string types before going into the orm with specific validators & transformers
case 'password': case 'password':
case 'email': case 'email':
case 'string': { case 'string':
case 'enumeration': {
return { type: 'string' }; return { type: 'string' };
} }
case 'uid': { case 'uid': {
@ -132,15 +133,6 @@ const getColumnType = attribute => {
case 'json': { case 'json': {
return { type: 'jsonb' }; return { type: 'jsonb' };
} }
case 'enumeration': {
return {
type: 'enum',
args: [
attribute.enum,
/*,{ useNative: true, existingType: true, enumName: 'foo_type', schemaName: 'public' }*/
],
};
}
case 'integer': { case 'integer': {
return { type: 'integer' }; return { type: 'integer' };
} }