create table

This commit is contained in:
Jan Prochazka
2021-09-09 16:40:52 +02:00
parent 275c57631b
commit aafa52db17
4 changed files with 57 additions and 11 deletions

View File

@@ -37,7 +37,7 @@
<script lang="ts">
import _ from 'lodash';
import { tick } from 'svelte';
import { onMount, tick } from 'svelte';
import invalidateCommands from '../commands/invalidateCommands';
import registerCommand from '../commands/registerCommand';
@@ -77,7 +77,7 @@
}
export function allowAddPrimaryKey() {
return writable() && !tableInfo.primaryKey;
return writable() && !tableInfo?.primaryKey;
}
export function addPrimaryKey() {
@@ -109,7 +109,8 @@
<div class="wrapper">
<ObjectListControl
collection={columns?.map((x, index) => ({ ...x, ordinal: index + 1 }))}
title="Columns"
title={`Columns (${columns?.length || 0})`}
showIfEmpty
clickable={writable()}
on:clickrow={e => showModal(ColumnEditorModal, { columnInfo: e.detail, tableInfo, setTableInfo })}
columns={[