mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-06 16:02:23 +00:00
Revert "refactor: reuse columnDefToTableEditorValuesColumn for default value handling"
This reverts commit bd8f071d9f.
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
<script module lang="ts">
|
||||
import {
|
||||
type TableEditorValues,
|
||||
type TableEditorValuesColumn,
|
||||
type TableEditorForeignKey,
|
||||
columnDefToTableEditorValuesColumn
|
||||
import type {
|
||||
TableEditorValues,
|
||||
TableEditorValuesColumn,
|
||||
TableEditorForeignKey
|
||||
} from '$lib/components/apps/components/display/dbtable/tableEditor'
|
||||
import type { ColumnMetadata } from '$lib/components/apps/components/display/dbtable/utils'
|
||||
import {
|
||||
diffTableEditorValues,
|
||||
type AlterTableValues,
|
||||
@@ -25,16 +23,14 @@
|
||||
if (!table || typeof table !== 'object') continue
|
||||
result[schemaName][tableName] = {
|
||||
name: table.name ?? tableName,
|
||||
columns: (table.columns ?? []).map((c: any) =>
|
||||
columnDefToTableEditorValuesColumn({
|
||||
field: c.name,
|
||||
datatype: c.datatype ?? '',
|
||||
defaultvalue: c.default_value ?? c.defaultValue ?? '',
|
||||
isprimarykey: c.primary_key ?? c.primaryKey ?? false,
|
||||
isidentity: 'No',
|
||||
isnullable: c.nullable === false ? 'NO' : 'YES',
|
||||
isenum: false
|
||||
} as ColumnMetadata)
|
||||
columns: (table.columns ?? []).map(
|
||||
(c: any): TableEditorValuesColumn => ({
|
||||
name: c.name,
|
||||
datatype: c.datatype,
|
||||
primaryKey: c.primary_key ?? c.primaryKey,
|
||||
defaultValue: c.default_value ?? c.defaultValue,
|
||||
nullable: c.nullable
|
||||
})
|
||||
),
|
||||
foreignKeys: (table.foreign_keys ?? table.foreignKeys ?? []).map(
|
||||
(fk: any): TableEditorForeignKey => ({
|
||||
|
||||
Reference in New Issue
Block a user