Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: missing column type (#7163)

rebeliceb9e2120f538d
diff --git a/backend/api/v1/schema_design_service.go b/backend/api/v1/schema_design_service.go
index 3352baa2e5..f887b404b0 100644
--- a/backend/api/v1/schema_design_service.go
+++ b/backend/api/v1/schema_design_service.go
@@ -774,7 +774,7 @@ type columnState struct {
}
func (c *columnState) toString(buf *strings.Builder) error {
- if _, err := buf.WriteString(fmt.Sprintf("`%s`", c.name)); err != nil {
+ if _, err := buf.WriteString(fmt.Sprintf("`%s` %s", c.name, c.tp)); err != nil {
return err
}
if c.nullable {
diff --git a/backend/api/v1/testdata/design.yaml b/backend/api/v1/testdata/design.yaml
index 33fc66ffec..3a0735857a 100644
--- a/backend/api/v1/testdata/design.yaml
+++ b/backend/api/v1/testdata/design.yaml
@@ -159,12 +159,12 @@
`a` varchar(10) NOT NULL DEFAULT 'default value' COMMENT 'this is comment, aha',
`c` int NOT NULL,
`e` int NULL,
- `b` NOT NULL DEFAULT NULL,
+ `b` char(10) NOT NULL DEFAULT NULL,
PRIMARY KEY (`a`, `b`, `c`),
CONSTRAINT `fk1` FOREIGN KEY (`b`) REFERENCES `t2` (`b`)
);
CREATE TABLE `t2` (
- `b` NULL DEFAULT NULL,
+ `b` int NULL DEFAULT NULL,
PRIMARY KEY (`b`),
CONSTRAINT `fk1` FOREIGN KEY (`b`) REFERENCES `t4` (`b`)
);