Skip to content

Commit

Permalink
[Steve/Deedee #50] Add email address for db migration for openMRS
Browse files Browse the repository at this point in the history
  • Loading branch information
deedee-thoughtworks committed Aug 24, 2020
1 parent 73a58a4 commit 68c1edd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openmrs/apps/registration/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@
"RationCard",
"familyIncome",
"debt",
"cluster"
"cluster",
"primaryContact",
"email"
]
},
"hidden": {
"attributes": [
"primaryContact"
]
},
"defaults": {
Expand Down Expand Up @@ -103,6 +104,7 @@
}
},
"fieldValidation" : {
"email" : {"pattern" : "^\\w+@[a-zA-Z_]+?.[a-zA-Z]{2,3}$", "errorMessage" : "Should be in email format"},
"primaryContact" : {"pattern" : "[0-9]{8,10}", "errorMessage" : "Should be 12 characters starting with 91 (country code)"},
"landHolding" : {"pattern" : "[0-9]{0,3}", "errorMessage" : "Should be between 1 to 999 acres"},
"familyName" : {"pattern" : "[a-zA-Z]{0,}", "errorMessage" : "Should contain characters"},
Expand Down
6 changes: 6 additions & 0 deletions openmrs/migrations/liquibase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,10 @@
INSERT INTO location_tag_map(location_id, location_tag_id) VALUES(@location_id, @location_tag_id);
</sql>
</changeSet>
<changeSet id="default-202008241710" author="Deedee Lee">
<comment> Email address </comment>
<sql>
INSERT INTO person_attribute_type (name, description, format, searchable, creator, date_created, retired, uuid) VALUES ('email', 'Email Address', 'java.lang.String', '1', 1, now(), 0, uuid());
</sql>
</changeSet>
</databaseChangeLog>

0 comments on commit 68c1edd

Please sign in to comment.