mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-09 16:36:27 +00:00
add comments to the export script
This commit is contained in:
committed by
Guy Ben-Aharon
parent
f61add50e9
commit
d4f226e40a
@@ -68,6 +68,18 @@ export const exportBaseSQL = (diagram: Diagram): string => {
|
|||||||
|
|
||||||
sqlScript += '\n);\n\n';
|
sqlScript += '\n);\n\n';
|
||||||
|
|
||||||
|
// Add table comment
|
||||||
|
if (table.comments) {
|
||||||
|
sqlScript += `COMMENT ON TABLE ${table.name} IS '${table.comments}';\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.fields.forEach((field) => {
|
||||||
|
// Add column comment
|
||||||
|
if (field.comments) {
|
||||||
|
sqlScript += `COMMENT ON COLUMN ${table.name}.${field.name} IS '${field.comments}';\n`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Generate SQL for indexes
|
// Generate SQL for indexes
|
||||||
table.indexes.forEach((index) => {
|
table.indexes.forEach((index) => {
|
||||||
const fieldNames = index.fieldIds
|
const fieldNames = index.fieldIds
|
||||||
|
|||||||
Reference in New Issue
Block a user