fix: dbml export renaming fields bug (#921)

This commit is contained in:
Guy Ben-Aharon
2025-09-17 14:27:53 +03:00
committed by GitHub
parent d6ba4a4074
commit 26dc299cd2
3 changed files with 20 additions and 161 deletions

View File

@@ -180,7 +180,7 @@ describe('DBML Schema Handling - Fantasy Realm Database', () => {
expect(artifactsTable?.schema).toBe(''); // No schema = empty string
});
it('should rename reserved keywords for PostgreSQL', async () => {
it('should handle reserved keywords for PostgreSQL', async () => {
const dbmlContent = `
Table "magic_items" {
"id" bigint [pk]
@@ -197,10 +197,9 @@ describe('DBML Schema Handling - Fantasy Realm Database', () => {
const exported = generateDBMLFromDiagram(diagram);
// For PostgreSQL, keywords should be renamed in export
expect(exported.standardDbml).toContain('Order_field');
expect(exported.standardDbml).toContain('Yes_field');
expect(exported.standardDbml).toContain('No_field');
expect(exported.standardDbml).toContain('Order');
expect(exported.standardDbml).toContain('Yes');
expect(exported.standardDbml).toContain('No');
});
});