Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: add \n in getMySQLDesignSchema (#8443)
h3n4lcd336c064a3f
diff --git a/backend/api/v1/schema_design_transformer.go b/backend/api/v1/schema_design_transformer.goindex 7b42e3e391..7ea911e67d 100644--- a/backend/api/v1/schema_design_transformer.go+++ b/backend/api/v1/schema_design_transformer.go@@ -750,6 +750,13 @@ func getMySQLDesignSchema(baselineSchema string, to *v1pb.DatabaseMetadata) (str}}+ // The last statement of the result is SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;+ // We should append a 0xa to the end of the result to avoid the extra newline diff.+ // TODO(rebelice/zp): find a more elegant way to do this.+ if err := listener.result.WriteByte('\n'); err != nil {+ return "", err+ }+return listener.result.String(), nil}diff --git a/backend/api/v1/testdata/design.yaml b/backend/api/v1/testdata/design.yamlindex 30f46b3a1f..321e956b74 100644--- a/backend/api/v1/testdata/design.yaml+++ b/backend/api/v1/testdata/design.yaml@@ -33,6 +33,7 @@comment: ""classification: ""usercomment: ""+ effectivemaskinglevel: 0indexes: []engine: ""collation: ""@@ -58,6 +59,7 @@comment: this is comment, ahaclassification: ""usercomment: ""+ effectivemaskinglevel: 0- name: bposition: 0default: null@@ -68,6 +70,7 @@comment: ""classification: ""usercomment: ""+ effectivemaskinglevel: 0- name: cposition: 0default: null@@ -78,6 +81,7 @@comment: ""classification: ""usercomment: ""+ effectivemaskinglevel: 0- name: eposition: 0default: null@@ -88,6 +92,7 @@comment: ""classification: ""usercomment: ""+ effectivemaskinglevel: 0indexes:- name: PRIMARYexpressions:@@ -132,6 +137,7 @@comment: ""classification: ""usercomment: ""+ effectivemaskinglevel: 0- name: aposition: 0default: null@@ -142,6 +148,7 @@comment: ""classification: ""usercomment: ""+ effectivemaskinglevel: 0indexes:- name: PRIMARYexpressions:@@ -179,7 +186,7 @@characterset: ""collation: ""extensions: []- result: |+ result: |+CREATE TABLE `t` (`a` int NOT NULL);@@ -198,3 +205,4 @@PRIMARY KEY (`b`),CONSTRAINT `fk1` FOREIGN KEY (`b`) REFERENCES `t4` (`b`));+