Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix export for enum and set types for mysql #252

Merged
merged 7 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/i18n/locales/hu.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ const hu = {
empty_index_name: "A(z) '{{tableName}}' táblában egy indexnek nincs megadva név",
didnt_find_diagram: "Hoppá! A diagram nem található.",
unsigned: "Előjel nélküli",
share: "Megosztás",
copy_link: "Hivatkozás másolása",
readme: "OLVASS_EL",
failed_to_load: "A betöltés sikertelen. Ellenőrizze a hivatkozás helyességét!",
share_info:
"* Ezen hivatkozás megosztása nem fog létrehozni élő, valósidejű együttműködési munkamenetet.",
},
};

Expand Down
3 changes: 2 additions & 1 deletion src/utils/exportSQL/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { parseDefault } from "./shared";
import { dbToTypes } from "../../data/datatypes";

export function toMySQL(diagram) {
console.log(diagram)
csc530 marked this conversation as resolved.
Show resolved Hide resolved
return `${diagram.tables
.map(
(table) =>
`CREATE TABLE \`${table.name}\` (\n${table.fields
.map(
(field) =>
`\t\`${field.name}\` ${field.type}${field.unsigned ? " UNSIGNED" : ""}${field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""}${
`\t\`${field.name}\` ${field.type}${field.values ? "(" + field.values.map(value=>"'" + value + "'").join(", ") + ")" : ""}${field.unsigned ? " UNSIGNED" : ""}${field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""}${
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please format. If you're on vscode you can use alt+shift+f

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'm using the default "typescript and javascript language features" formatter in vscode

field.notNull ? " NOT NULL" : ""
}${
field.increment ? " AUTO_INCREMENT" : ""
Expand Down