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

[Task] <set the special field string length when jpa auto ddl> #870

Closed
1 task
tomsun28 opened this issue Apr 13, 2023 · 4 comments
Closed
1 task

[Task] <set the special field string length when jpa auto ddl> #870

tomsun28 opened this issue Apr 13, 2023 · 4 comments

Comments

@tomsun28
Copy link
Contributor

Description

set the special field string length when jpa auto ddl
eg: tags field length 2048

Task List

  • set the special field string length when jpa auto ddl
@dhruva1995
Copy link
Contributor

Hey @tomsun28, can you please elaborate the issue in detail, I am just getting started on places where I could contribute, I am happy to complete this.

@tomsun28
Copy link
Contributor Author

hi welcome @dhruva1995.
Now we use jpa auto ddl to auto create table when startup first time. If we do not customize the table field type length, the default table field string length is varchar(255), which is not enough for some special fields such as tags, and will cause exception when the field is too long.
So this task is to config the special field string length in @Table file by using java code @Column(length = 2048)
Example Before.

    @Schema(description = "Tags(monitorId:xxx,monitorName:xxx)", example = "{name: key1, value: value1}",
            accessMode = READ_WRITE)
    @Convert(converter = JsonTagListAttributeConverter.class)
    private List<TagItem> tags;

Update:

    @Schema(description = "Tags(monitorId:xxx,monitorName:xxx)", example = "{name: key1, value: value1}",
            accessMode = READ_WRITE)
    @Convert(converter = JsonTagListAttributeConverter.class)
    @Column(length = 2048)
    private List<TagItem> tags;

special table fields: tags, content, template, Param->value

@dhruva1995
Copy link
Contributor

Hi @tomsun28 probably you can close this task.

@tomsun28
Copy link
Contributor Author

tomsun28 commented May 4, 2023

Hi @tomsun28 probably you can close this task.

ok thanks. it has supported in v1.3.1

@tomsun28 tomsun28 closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants