mirror of
https://github.com/directus/directus.git
synced 2026-02-08 22:44:56 -05:00
Fix quotes with schema default values (#6968)
* Added quote trimming to schema default values * Add return type to stripQuotes function Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import extractMaxLength from 'knex-schema-inspector/dist/utils/extract-max-lengt
|
||||
import extractType from 'knex-schema-inspector/dist/utils/extract-type';
|
||||
import { SchemaOverview } from '../types/overview';
|
||||
import { SchemaInspector } from '../types/schema';
|
||||
import { stripQuotes } from '../utils/strip-quotes';
|
||||
|
||||
type RawColumn = {
|
||||
cid: number;
|
||||
@@ -39,7 +40,7 @@ export default class SQLite extends KnexSQLite implements SchemaInspector {
|
||||
default_value:
|
||||
column.pk === 1 && tablesWithAutoIncrementPrimaryKeys.includes(table)
|
||||
? 'AUTO_INCREMENT'
|
||||
: column.dflt_value,
|
||||
: stripQuotes(column.dflt_value),
|
||||
is_nullable: column.notnull == 0,
|
||||
data_type: extractType(column.type),
|
||||
max_length: extractMaxLength(column.type),
|
||||
|
||||
Reference in New Issue
Block a user