Skip to content

Commit

Permalink
Merge branch 'main' into UpdateRateLimitFilterEmail
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro authored Dec 16, 2024
2 parents 538800c + cccb6a1 commit e1e2501
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.69.2 - 2024-12-16

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.69.1...v2.69.2)

## v2.69.1 - 2024-12-13

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.69.0...v2.69.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ public class ProfileEmailDomain {

private Date lastModified;

private Boolean generatedByScript;

public static ProfileEmailDomain valueOf(ProfileEmailDomainEntity ed) {
ProfileEmailDomain emailDomain = new ProfileEmailDomain();

if (ed != null) {
emailDomain.setValue(ed.getEmailDomain());
emailDomain.setVisibility(ed.getVisibility());
emailDomain.setGeneratedByScript(ed.getGeneratedByScript());

if (ed.getDateCreated() != null) {
Date createdDate = new Date();
Expand Down Expand Up @@ -77,4 +80,8 @@ public Date getLastModified() {
public void setLastModified(Date lastModified) {
this.lastModified = lastModified;
}

public Boolean getGeneratedByScript() { return generatedByScript; }

public void setGeneratedByScript(Boolean generatedByScript) { this.generatedByScript = generatedByScript; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ProfileEmailDomainEntity extends BaseEntity<Long> {
private String emailDomain;
private String visibility;
private Date dateCreated;
private Boolean generatedByScript;

@Id
@Column(name = "id")
Expand Down Expand Up @@ -67,6 +68,15 @@ public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
}

@Column(name = "generated_by_script")
public Boolean getGeneratedByScript() {
return generatedByScript;
}

public void setGeneratedByScript(Boolean generatedByScript) {
this.generatedByScript = generatedByScript;
}


@Override
public boolean equals(Object obj) {
Expand Down
1 change: 1 addition & 0 deletions orcid-persistence/src/main/resources/db-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,5 @@
<include file="/db/updates/add_date_verified_to_email.xml" />
<include file="/db/updates/create_public_api_daily_rate_limit.xml" />
<include file="/db/updates/add_public_api_daily_rate_limit_indexes.xml" />
<include file="/db/updates/add_generated_by_script_column_to_profile_email_domain.xml" />
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
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-2.0.xsd">

<changeSet author="Andrej Romanov" id="ADD-GENERATED-BY-SCRIPT-TO-PROFILE-EMAIL-DOMAIN-TABLE">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="profile_email_domain" columnName="generated_by_script"/>
</not>
</preConditions>
<sql>ALTER TABLE profile_email_domain ADD generated_by_script boolean default false;</sql>
</changeSet>

<changeSet author="Andrej Romanov" id="UPDATE-GENERATED-BY-SCRIPT-BASED-ON-CREATED-DATE" dbms="postgresql">
<sql>
UPDATE profile_email_domain SET generated_by_script = true WHERE date_created &lt; '2024-10-28';
</sql>
</changeSet>
</databaseChangeLog>

0 comments on commit e1e2501

Please sign in to comment.