mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-03 05:23:26 +00:00
fix: import array fields (#961)
This commit is contained in:
@@ -60,6 +60,7 @@ export const createFieldsFromMetadata = ({
|
||||
...(col.is_identity !== undefined
|
||||
? { increment: col.is_identity }
|
||||
: {}),
|
||||
...(col.is_array !== undefined ? { isArray: col.is_array } : {}),
|
||||
createdAt: Date.now(),
|
||||
comments: col.comment ? col.comment : undefined,
|
||||
})
|
||||
|
||||
@@ -64,7 +64,7 @@ export const loadFromDatabaseMetadata = async ({
|
||||
const diagram: Diagram = {
|
||||
id: generateDiagramId(),
|
||||
name: databaseMetadata.database_name
|
||||
? `${databaseMetadata.database_name}-db`
|
||||
? `${databaseMetadata.database_name}`
|
||||
: diagramNumber
|
||||
? `Diagram ${diagramNumber}`
|
||||
: 'New Diagram',
|
||||
|
||||
@@ -15,7 +15,8 @@ export interface ColumnInfo {
|
||||
default?: string | null; // Default value for the column, nullable
|
||||
collation?: string | null;
|
||||
comment?: string | null;
|
||||
is_identity?: boolean; // Indicates if the column is auto-increment/identity
|
||||
is_identity?: boolean | null; // Indicates if the column is auto-increment/identity
|
||||
is_array?: boolean | null; // Indicates if the column is an array type
|
||||
}
|
||||
|
||||
export const ColumnInfoSchema: z.ZodType<ColumnInfo> = z.object({
|
||||
@@ -36,5 +37,6 @@ export const ColumnInfoSchema: z.ZodType<ColumnInfo> = z.object({
|
||||
default: z.string().nullable().optional(),
|
||||
collation: z.string().nullable().optional(),
|
||||
comment: z.string().nullable().optional(),
|
||||
is_identity: z.boolean().optional(),
|
||||
is_identity: z.boolean().nullable().optional(),
|
||||
is_array: z.boolean().nullable().optional(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user