forked from box/mojito
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use auto incrementable int as primary key, add created and modified d…
…ate to entity, renamed isOrdered method
- Loading branch information
Showing
11 changed files
with
89 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...rc/main/java/com/box/l10n/mojito/service/thirdparty/ThirdPartyFileChecksumRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
package com.box.l10n.mojito.service.thirdparty; | ||
|
||
import com.box.l10n.mojito.entity.ThirdPartyFileChecksum; | ||
import com.box.l10n.mojito.entity.ThirdPartyFileChecksumId; | ||
import com.box.l10n.mojito.entity.ThirdPartyFileChecksumCompositeId; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.rest.core.annotation.RepositoryRestResource; | ||
|
||
@RepositoryRestResource(exported = false) | ||
public interface ThirdPartyFileChecksumRepository | ||
extends JpaRepository<ThirdPartyFileChecksum, ThirdPartyFileChecksumId> { | ||
extends JpaRepository<ThirdPartyFileChecksum, ThirdPartyFileChecksumCompositeId> { | ||
|
||
Optional<ThirdPartyFileChecksum> findByThirdPartyFileChecksumId( | ||
ThirdPartyFileChecksumId thirdPartyFileChecksumId); | ||
Optional<ThirdPartyFileChecksum> findById(Long thirdPartyFileChecksumId); | ||
|
||
Optional<ThirdPartyFileChecksum> findByThirdPartyFileChecksumCompositeId( | ||
ThirdPartyFileChecksumCompositeId thirdPartyFileChecksumCompositeId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
webapp/src/main/resources/db/migration/V64__third_party_sync_file_checksum.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
create table third_party_sync_file_checksum (repository_id bigint not null, locale_id bigint not null, checksum char(32) not null, file_name varchar(255) not null); | ||
create table third_party_sync_file_checksum ( | ||
id bigint(20) NOT NULL AUTO_INCREMENT, | ||
repository_id bigint not null, | ||
locale_id bigint not null, | ||
md5 char(32) not null, | ||
file_name varchar(255) not null, | ||
created_date datetime not null, | ||
last_modified_date datetime, | ||
primary key (id) | ||
); | ||
alter table third_party_sync_file_checksum add constraint FK__THIRD_PARTY_CHECKSUM__REPO__ID foreign key (repository_id) references repository (id); | ||
alter table third_party_sync_file_checksum add constraint FK__THIRD_PARTY_CHECKSUM__LOCALE__ID foreign key (locale_id) references locale (id); | ||
create index I__THIRD_PARTY__CHECKSUM__REPOSITORY_ID__FILE_NAME__LOCALE_ID on third_party_sync_file_checksum(repository_id, locale_id, file_name); | ||
create unique index I__THIRD_PARTY__CHECKSUM__REPOSITORY_ID__FILE_NAME__LOCALE_ID on third_party_sync_file_checksum(repository_id, locale_id, file_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters