Fix things for MySQL

This commit is contained in:
rijkvanzanten
2020-07-29 16:13:29 -04:00
parent e94b991a82
commit f28e413b1c
7 changed files with 163 additions and 90 deletions

View File

@@ -42,14 +42,10 @@ export default class FieldsService {
fields = (await this.service.readByQuery({})) as Field[];
}
const fieldsQuery = this.knex.select('*').from('directus_fields');
if (collection) {
fieldsQuery.where({ collection });
}
const columns = await schemaInspector.columnInfo(collection);
console.log(columns);
return columns.map((column) => {
const field = fields.find(
(field) => field.field === column.name && field.collection === column.table