Skip to content

FIX: DB Schema Generator issues#389

Merged
kishorereddy merged 3 commits into
mainfrom
fix/2501230-db
Jan 30, 2026
Merged

FIX: DB Schema Generator issues#389
kishorereddy merged 3 commits into
mainfrom
fix/2501230-db

Conversation

@kishorereddy

@kishorereddy kishorereddy commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

Overview

Fix misc database schema generator issues. See example below

  1. Postgres: Fix support for double fields/types, double now mapped to FLOAT8
  2. Formatting: The schema ddl generated is messy/unformatted, this formats it
  3. Migration: The migration service is updated to handle the formatting above
  4. Grouping: The migration service can group multiple DDLs into 1 file based for the same model schema.

Example: Formatting + Float8

create table if not exists "unit_tests"."sample1" ( 
"id"                  BIGSERIAL    NOT NULL  PRIMARY KEY, 
"test_string"         VARCHAR(30)  NOT NULL  , 
"test_stringOpt"      VARCHAR(30)            , 
"test_string_enc"     VARCHAR(100) NOT NULL  , 
"test_bool"           BOOLEAN      NOT NULL  , 
"test_short"          SMALLINT     NOT NULL  , 
"test_int"            INTEGER      NOT NULL  , 
"test_long"           BIGINT       NOT NULL  , 
"test_float"          FLOAT        NOT NULL  , 
"test_double"         FLOAT8       NOT NULL  , 
"test_enum"           INTEGER      NOT NULL  , 
"test_localdate"      DATE         NOT NULL  , 
"test_localtime"      TIME         NOT NULL  , 
"test_localdatetime"  TIMESTAMP    NOT NULL  , 
"test_zoneddatetime"  TIMESTAMPTZ  NOT NULL  , 
"test_uuid"           VARCHAR(50)  NOT NULL  , 
"test_uniqueId"       VARCHAR(50)  NOT NULL  , 
"test_object_addr"    VARCHAR(40)  NOT NULL  , 
"test_object_city"    VARCHAR(30)  NOT NULL  , 
"test_object_state"   VARCHAR(20)  NOT NULL  , 
"test_object_country" INTEGER      NOT NULL  , 
"test_object_zip"     VARCHAR(5)   NOT NULL  , 
"test_object_isPOBox" BOOLEAN      NOT NULL   );

Example: Models

The Account and User models here are both in the users schema.
So the migration service will generate both

  1. A single file for each model
  2. A single file for all the Model DDLs statements.

1. 1 File per model - users-account.sql

create table if not exists "users"."account" ( 
...

2. 1 File for all models - users.sql

create table if not exists "users"."account" ( 
...
create table if not exists "users"."user" ( ...
...

Ticket(s)

n/a

Links(s)

n/a

Dependencies

n/a

Design

  1. SqlDDLColumn
  2. SqlDDLGroup

Notes

Pending

Tests

@kishorereddy kishorereddy merged commit b0cc5ea into main Jan 30, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant