mirror of
https://github.com/chartdb/chartdb.git
synced 2025-10-23 07:11:56 +00:00
Compare commits
3 Commits
6ba7b2544b
...
8f053996a0
Author | SHA1 | Date | |
---|---|---|---|
|
8f053996a0 | ||
|
bcd8aa9378 | ||
|
b15bc945ac |
@@ -1,12 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## [1.16.1](https://github.com/chartdb/chartdb/compare/v1.16.0...v1.16.1) (2025-09-28)
|
||||
## [1.16.1](https://github.com/chartdb/chartdb/compare/v1.16.0...v1.16.1) (2025-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add auto-increment field detection in smart-query import ([#935](https://github.com/chartdb/chartdb/issues/935)) ([57b3b87](https://github.com/chartdb/chartdb/commit/57b3b8777fd0a445abf0ba6603faab612d469d5c))
|
||||
* add rels export dbml ([#937](https://github.com/chartdb/chartdb/issues/937)) ([c3c646b](https://github.com/chartdb/chartdb/commit/c3c646bf7cbb1328f4b2eb85c9a7e929f0fcd3b9))
|
||||
* add timestampz and int as datatypes to postgres ([#940](https://github.com/chartdb/chartdb/issues/940)) ([b15bc94](https://github.com/chartdb/chartdb/commit/b15bc945acb96d7cb3832b3b1b607dfcaef9e5ca))
|
||||
* auto-enter edit mode when creating new tables from canvas ([#943](https://github.com/chartdb/chartdb/issues/943)) ([bcd8aa9](https://github.com/chartdb/chartdb/commit/bcd8aa9378aa563f40a2b6802cc503be4c882356))
|
||||
* dbml diff fields types preview ([#934](https://github.com/chartdb/chartdb/issues/934)) ([bb03309](https://github.com/chartdb/chartdb/commit/bb033091b1f64b888822be1423a80f16f5314f6b))
|
||||
|
||||
## [1.16.0](https://github.com/chartdb/chartdb/compare/v1.15.1...v1.16.0) (2025-09-24)
|
||||
|
@@ -350,6 +350,7 @@ export const ChartDBProvider: React.FC<
|
||||
isView: false,
|
||||
order: tables.length,
|
||||
...attributes,
|
||||
schema: attributes?.schema ?? defaultSchemas[databaseType],
|
||||
};
|
||||
|
||||
table.indexes = getTableIndexesWithPrimaryKey({
|
||||
|
@@ -12,6 +12,7 @@ export const postgresDataTypes: readonly DataTypeData[] = [
|
||||
{ name: 'text', id: 'text', usageLevel: 1 },
|
||||
{ name: 'boolean', id: 'boolean', usageLevel: 1 },
|
||||
{ name: 'timestamp', id: 'timestamp', usageLevel: 1 },
|
||||
{ name: 'timestamptz', id: 'timestamptz', usageLevel: 1 },
|
||||
{ name: 'date', id: 'date', usageLevel: 1 },
|
||||
|
||||
// Level 2 - Second most common types
|
||||
@@ -42,6 +43,7 @@ export const postgresDataTypes: readonly DataTypeData[] = [
|
||||
id: 'timestamp_with_time_zone',
|
||||
usageLevel: 2,
|
||||
},
|
||||
{ name: 'int', id: 'int', usageLevel: 2 },
|
||||
|
||||
// Less common types
|
||||
{
|
||||
|
@@ -13,6 +13,8 @@ import { useTranslation } from 'react-i18next';
|
||||
import { Table, Workflow, Group, View } from 'lucide-react';
|
||||
import { useDiagramFilter } from '@/context/diagram-filter-context/use-diagram-filter';
|
||||
import { useLocalConfig } from '@/hooks/use-local-config';
|
||||
import { useCanvas } from '@/hooks/use-canvas';
|
||||
import type { DBTable } from '@/lib/domain';
|
||||
|
||||
export const CanvasContextMenu: React.FC<React.PropsWithChildren> = ({
|
||||
children,
|
||||
@@ -23,24 +25,28 @@ export const CanvasContextMenu: React.FC<React.PropsWithChildren> = ({
|
||||
const { screenToFlowPosition } = useReactFlow();
|
||||
const { t } = useTranslation();
|
||||
const { showDBViews } = useLocalConfig();
|
||||
const { setEditTableModeTable } = useCanvas();
|
||||
|
||||
const { isMd: isDesktop } = useBreakpoint('md');
|
||||
|
||||
const createTableHandler = useCallback(
|
||||
(event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
||||
async (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
||||
const position = screenToFlowPosition({
|
||||
x: event.clientX,
|
||||
y: event.clientY,
|
||||
});
|
||||
|
||||
let newTable: DBTable | null = null;
|
||||
|
||||
if (schemasDisplayed.length > 1) {
|
||||
openTableSchemaDialog({
|
||||
onConfirm: ({ schema }) =>
|
||||
createTable({
|
||||
onConfirm: async ({ schema }) => {
|
||||
newTable = await createTable({
|
||||
x: position.x,
|
||||
y: position.y,
|
||||
schema: schema.name,
|
||||
}),
|
||||
});
|
||||
},
|
||||
schemas: schemasDisplayed,
|
||||
});
|
||||
} else {
|
||||
@@ -48,37 +54,45 @@ export const CanvasContextMenu: React.FC<React.PropsWithChildren> = ({
|
||||
schemasDisplayed?.length === 1
|
||||
? schemasDisplayed[0]?.name
|
||||
: undefined;
|
||||
createTable({
|
||||
newTable = await createTable({
|
||||
x: position.x,
|
||||
y: position.y,
|
||||
schema,
|
||||
});
|
||||
}
|
||||
|
||||
if (newTable) {
|
||||
setEditTableModeTable({ tableId: newTable.id });
|
||||
}
|
||||
},
|
||||
[
|
||||
createTable,
|
||||
screenToFlowPosition,
|
||||
openTableSchemaDialog,
|
||||
schemasDisplayed,
|
||||
setEditTableModeTable,
|
||||
]
|
||||
);
|
||||
|
||||
const createViewHandler = useCallback(
|
||||
(event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
||||
async (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
||||
const position = screenToFlowPosition({
|
||||
x: event.clientX,
|
||||
y: event.clientY,
|
||||
});
|
||||
|
||||
let newView: DBTable | null = null;
|
||||
|
||||
if (schemasDisplayed.length > 1) {
|
||||
openTableSchemaDialog({
|
||||
onConfirm: ({ schema }) =>
|
||||
createTable({
|
||||
onConfirm: async ({ schema }) => {
|
||||
newView = await createTable({
|
||||
x: position.x,
|
||||
y: position.y,
|
||||
schema: schema.name,
|
||||
isView: true,
|
||||
}),
|
||||
});
|
||||
},
|
||||
schemas: schemasDisplayed,
|
||||
});
|
||||
} else {
|
||||
@@ -86,19 +100,24 @@ export const CanvasContextMenu: React.FC<React.PropsWithChildren> = ({
|
||||
schemasDisplayed?.length === 1
|
||||
? schemasDisplayed[0]?.name
|
||||
: undefined;
|
||||
createTable({
|
||||
newView = await createTable({
|
||||
x: position.x,
|
||||
y: position.y,
|
||||
schema,
|
||||
isView: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (newView) {
|
||||
setEditTableModeTable({ tableId: newView.id });
|
||||
}
|
||||
},
|
||||
[
|
||||
createTable,
|
||||
screenToFlowPosition,
|
||||
openTableSchemaDialog,
|
||||
schemasDisplayed,
|
||||
setEditTableModeTable,
|
||||
]
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user