Skip to content

Commit

Permalink
Фикс видов
Browse files Browse the repository at this point in the history
  • Loading branch information
yrlvdplsh committed Mar 4, 2025
1 parent 6f727d2 commit 7da87f4
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
import club.ttg.dnd5.domain.book.model.Book;
import club.ttg.dnd5.domain.common.model.NamedEntity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(
name = "species_features",
indexes = {@Index(name = "url_index", columnList = "url")}
)
public class SpeciesFeature extends NamedEntity {
@Column(nullable = false)
@AllArgsConstructor
@NoArgsConstructor
public class SpeciesFeature {
private String name;
@Column(columnDefinition = "TEXT")
private String description;
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public interface SpeciesFeatureMapper {
@Mapping(target = "name.name", source = "name")
SpeciesFeatureResponse toDto(SpeciesFeature speciesFeature);

@Mapping(target = "url", source = "name", qualifiedByName = "generateUrl")
@Mapping(target = "english", source = "name", qualifiedByName = "generateUrl")
SpeciesFeature toEntity(FeatureRequest request);

@Named("generateUrl")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package club.ttg.dnd5.domain.species.service;

import club.ttg.dnd5.domain.common.repository.TagRepository;
import club.ttg.dnd5.domain.species.repository.SpeciesFeatureRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class TagService {
private final TagRepository tagRepository;
private final SpeciesFeatureRepository speciesFeatureRepository;

// public Tag createTag(String tagName) {
// Tag tag = new Tag(tagName);
Expand Down
64 changes: 64 additions & 0 deletions src/main/resources/db/changelog/2025/03/04-02-update-species.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
databaseChangeLog:
- changeSet:
id: 1741079793151-3
author: ylp
objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
changes:
- dropForeignKeyConstraint:
baseTableName: sources
constraintName: fk_sources_on_book_info
- changeSet:
id: 1741079793151-4
author: ylp
objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
changes:
- dropForeignKeyConstraint:
baseTableName: species_features
constraintName: fk_species_features_on_source
- changeSet:
id: 1741079793151-5
author: ylp
objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
changes:
- dropForeignKeyConstraint:
baseTableName: species_features
constraintName: fk_species_features_on_species_url
- changeSet:
id: 1741079793151-1
author: ylp
objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
changes:
- addColumn:
columns:
- column:
name: features
type: jsonb
tableName: species
- changeSet:
id: 1741079793151-2
author: ylp
objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
changes:
- addForeignKeyConstraint:
baseColumnNames: source
baseTableName: species
constraintName: FK_SPECIES_ON_SOURCE
referencedColumnNames: source_acronym
referencedTableName: books
- changeSet:
id: 1741079793151-9
author: ylp
objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
changes:
- dropTable:
cascadeConstraints: true
tableName: sources
- changeSet:
id: 1741079793151-10
author: ylp
objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
changes:
- dropTable:
cascadeConstraints: true
tableName: species_features

12 changes: 8 additions & 4 deletions src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
databaseChangeLog:

- includeAll:
path: /2025
relativeToChangelogFile: true
- include:
file: db/changelog/2025/03/01-init_users_and_tokens_tables.yaml
- include:
file: db/changelog/2025/03/02-add_species_table.yaml.yaml
- include:
file: db/changelog/2025/03/04-update-species.yaml
- include:
file: db/changelog/2025/03/04-02-update-species.yaml

0 comments on commit 7da87f4

Please sign in to comment.