Skip to content

Commit

Permalink
larger description for skills
Browse files Browse the repository at this point in the history
Skills can now hold the size of text. This allow for arbitrary lenghts
see also https://www.postgresql.org/docs/15/datatype-character.html.
This means, the string can be as large as the max length of java String
type that is 2^31-1.

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
  • Loading branch information
Weltraumschaf committed Jul 19, 2023
1 parent 00bb4d8 commit 5f9ad7c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .jhipster/Skill.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"fieldName": "descriptionEN",
"fieldType": "String",
"fieldValidateRules": ["maxlength"],
"fieldValidateRulesMaxlength": "8192"
"fieldValidateRulesMaxlength": "2147483647"
},
{
"fieldName": "descriptionDE",
"fieldType": "String",
"fieldValidateRules": ["maxlength"],
"fieldValidateRulesMaxlength": "8192"
"fieldValidateRulesMaxlength": "2147483647"
},
{
"fieldName": "implementationEN",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<column name="title_de" type="varchar(80)">
<constraints nullable="true" />
</column>
<column name="description_en" type="varchar(8192)">
<column name="description_en" type="varchar(4096)">
<constraints nullable="true" />
</column>
<column name="description_de" type="varchar(8192)">
<column name="description_de" type="varchar(4096)">
<constraints nullable="true" />
</column>
<column name="implementation_en" type="varchar(4096)">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.6.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

<!--
Change description length
-->
<changeSet id="20230511163039_1" author="Sven Marquardt">
<modifyDataType tableName="skill" columnName="description_de" newDataType="text"/>
<modifyDataType tableName="skill" columnName="description_en" newDataType="text"/>
</changeSet>
</databaseChangeLog>
1 change: 1 addition & 0 deletions src/main/resources/config/liquibase/master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<!-- ### MODIFICATION-START ### -->
<include file="config/liquibase/changelog/20210803214100_added_entity_Image_badge_default.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20210803214100_added_entity_Image_level_default.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20230511163039_edit_entity_Skill_change_size_of_description.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/initial_demo_data.xml" relativeToChangelogFile="false"/>
<!-- ### MODIFICATION-END ### -->
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ <h2 id="jhi-skill-heading" data-cy="SkillCreateUpdateHeading" jhiTranslate="team
class="form-text text-danger"
*ngIf="editForm.get('descriptionEN')?.errors?.maxlength"
jhiTranslate="entity.validation.maxlength"
[translateValues]="{ max: 8192 }"
[translateValues]="{ max: 2147483647 }"
>
This field cannot be longer than 8192 characters.
This field cannot be longer than 2147483647 characters.
</small>
</div>
</div>
Expand Down Expand Up @@ -126,9 +126,9 @@ <h2 id="jhi-skill-heading" data-cy="SkillCreateUpdateHeading" jhiTranslate="team
class="form-text text-danger"
*ngIf="editForm.get('descriptionDE')?.errors?.maxlength"
jhiTranslate="entity.validation.maxlength"
[translateValues]="{ max: 8192 }"
[translateValues]="{ max: 2147483647 }"
>
This field cannot be longer than 8192 characters.
This field cannot be longer than 2147483647 characters.
</small>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export class SkillUpdateComponent implements OnInit {
id: [],
titleEN: [null, [Validators.required, Validators.minLength(5), Validators.maxLength(80)]],
titleDE: [null, [Validators.minLength(5), Validators.maxLength(80)]],
descriptionEN: [null, [Validators.maxLength(8192)]],
descriptionDE: [null, [Validators.maxLength(8192)]],
descriptionEN: [null, [Validators.maxLength(2147483647)]],
descriptionDE: [null, [Validators.maxLength(2147483647)]],
implementationEN: [null, [Validators.maxLength(4096)]],
implementationDE: [null, [Validators.maxLength(4096)]],
validationEN: [null, [Validators.maxLength(4096)]],
Expand Down
4 changes: 2 additions & 2 deletions teamDojo_v2.jdl
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ entity Report {
entity Skill {
titleEN String required minlength(5) maxlength(80)
titleDE String minlength(5) maxlength(80)
descriptionEN String maxlength(8192)
descriptionDE String maxlength(8192)
descriptionEN String maxlength(2147483647)
descriptionDE String maxlength(2147483647)
implementationEN String maxlength(4096)
implementationDE String maxlength(4096)
validationEN String maxlength(4096)
Expand Down

0 comments on commit 5f9ad7c

Please sign in to comment.