-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add type size when exporting postgres #258
Conversation
Add timetz datatype for postgres
Add "GENERATED BY DEFAULT AS IDENTITY" if field is auto increment
Fix postgres auto increment primary key
@rudcode is attempting to deploy a commit to the dottle's projects Team on Vercel. A member of the Team first needs to authorize it. |
hasPrecision: false, | ||
defaultSize: 65535, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how these changes would impact other database engines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't impact any other database, because each database have their own {database}TypesBase.
@@ -31,7 +31,9 @@ export function toPostgres(diagram) { | |||
(field) => | |||
`${exportFieldComment(field.comment)}\t"${ | |||
field.name | |||
}" ${field.type}${field.isArray ? " ARRAY" : ""}${field.notNull ? " NOT NULL" : ""}${field.unique ? " UNIQUE" : ""}${ | |||
}" ${field.type}${ | |||
field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : "" | |
field.size ? "(" + field.size + ")" : "" |
isn't this enough? or we need to test against undefined/empty for some reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I just copy this from https://github.com/drawdb-io/drawdb/blob/main/src/utils/exportSQL/mysql.js#L12
But I think we need to test it against empty so it doesn't produce something like "VARCHAR()"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all fields have a size so yeah
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
No description provided.