mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Switch Enum from native type to string or text
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
This commit is contained in:
parent
073f279e91
commit
e16bf9b259
@ -63,7 +63,7 @@ const toStrapiType = column => {
|
||||
return { type: 'bigInteger' };
|
||||
}
|
||||
case 'enum': {
|
||||
return { type: 'enum' };
|
||||
return { type: 'string' };
|
||||
}
|
||||
case 'tinyint': {
|
||||
return { type: 'boolean' };
|
||||
|
||||
@ -34,7 +34,6 @@ class SqliteDialect extends Dialect {
|
||||
|
||||
getSqlType(type) {
|
||||
switch (type) {
|
||||
// FIXME: enum must be dealt separately
|
||||
case 'enum': {
|
||||
return 'text';
|
||||
}
|
||||
|
||||
@ -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' };
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user