Kishore

Are all the rows in the first table also missing the FK?  Those
relationships are correct and need an FK if its missing.  Create a ticket
for that?

Are you sure all those uuid columns are nullable?  I spot checked a few in
my db and they are all NOT NULL.  If you find any that are truly that way
we need a new ticket for it.

hl7_code is right, that should be nullable and unique.  Not sure about the
concept_state_conversion workflow id off the top of my head.

Ben

On Thu, Jan 19, 2012 at 12:25 PM, Yekkanti Kishore Kumar <
[email protected]> wrote:

> Hey Darius,
> Below are the list of anomalies detected by schema spy.
>
> *Things that might not be 'quite right' about your schema:*
>
>    - *Columns whose name and type imply a relationship to another table's
>    primary key:* Child Column Implied Parent 
> Columnactive_list<http://tables/active_list.html>
>    .active_list_id active_list_problem<http://tables/active_list_problem.html>
>    .active_list_id active_list_allergy<http://tables/active_list_allergy.html>
>    .active_list_id active_list_problem<http://tables/active_list_problem.html>
>    .active_list_id concept_set <http://tables/concept_set.html>.concept_id
>    concept_numeric <http://tables/concept_numeric.html>.concept_id
>    concept_set_derived <http://tables/concept_set_derived.html>.concept_id
>    concept_numeric <http://tables/concept_numeric.html>.concept_id
>    htmlformentry_html_form <http://tables/htmlformentry_html_form.html>.id
>    liquibasechangeloglock <http://tables/liquibasechangeloglock.html>.ID
>    logic_rule_definition <http://tables/logic_rule_definition.html>.id
>    liquibasechangeloglock <http://tables/liquibasechangeloglock.html>.ID
>    orders <http://tables/orders.html>.concept_id 
> concept_numeric<http://tables/concept_numeric.html>
>    .concept_id patient_identifier <http://tables/patient_identifier.html>
>    .patient_id patient <http://tables/patient.html>.patient_id 8
>    instances of anomaly detected
>
>    - *Tables without indexes:*
>    Anomaly not detected
>
>    - *Columns that are flagged as both 'nullable' and 'must be unique':*
>    Column cohort <http://tables/cohort.html>.uuid 
> concept<http://tables/concept.html>
>    .uuid concept_answer <http://tables/concept_answer.html>.uuid
>    concept_class <http://tables/concept_class.html>.uuid 
> concept_datatype<http://tables/concept_datatype.html>
>    .uuid concept_description <http://tables/concept_description.html>.uuid
>    concept_name <http://tables/concept_name.html>.uuid 
> concept_name_tag<http://tables/concept_name_tag.html>
>    .uuid concept_proposal <http://tables/concept_proposal.html>.uuid
>    concept_reference_source <http://tables/concept_reference_source.html>
>    .hl7_code concept_set <http://tables/concept_set.html>.uuid
>    concept_state_conversion <http://tables/concept_state_conversion.html>
>    .concept_id 
> concept_state_conversion<http://tables/concept_state_conversion.html>
>    .program_workflow_id 
> concept_state_conversion<http://tables/concept_state_conversion.html>
>    .uuid drug <http://tables/drug.html>.uuid 
> encounter<http://tables/encounter.html>
>    .uuid encounter_type <http://tables/encounter_type.html>.uuid 
> field<http://tables/field.html>
>    .uuid  field_answer <http://tables/field_answer.html>.uuid 
> field_type<http://tables/field_type.html>
>    .uuid form <http://tables/form.html>.uuid 
> form_field<http://tables/form_field.html>
>    .uuid global_property <http://tables/global_property.html>.uuid
>    hl7_in_archive <http://tables/hl7_in_archive.html>.uuid 
> hl7_in_error<http://tables/hl7_in_error.html>
>    .uuid hl7_in_queue <http://tables/hl7_in_queue.html>.uuid 
> hl7_source<http://tables/hl7_source.html>
>    .uuid location <http://tables/location.html>.uuid 
> location_tag<http://tables/location_tag.html>
>    .uuid 
> metadatasharing_subscription<http://tables/metadatasharing_subscription.html>
>    .group_uuid note <http://tables/note.html>.uuid 
> notification_alert<http://tables/notification_alert.html>
>    .uuid notification_template <http://tables/notification_template.html>
>    .uuid obs <http://tables/obs.html>.uuid  
> order_type<http://tables/order_type.html>
>    .uuid orders <http://tables/orders.html>.uuid 
> patient_identifier<http://tables/patient_identifier.html>
>    .uuid patient_identifier_type<http://tables/patient_identifier_type.html>
>    .uuid patient_program <http://tables/patient_program.html>.uuid
>    patient_state <http://tables/patient_state.html>.uuid 
> person<http://tables/person.html>
>    .uuid person_address <http://tables/person_address.html>.uuid
>    person_attribute <http://tables/person_attribute.html>.uuid
>    person_attribute_type <http://tables/person_attribute_type.html>.uuid
>    person_name <http://tables/person_name.html>.uuid 
> privilege<http://tables/privilege.html>
>    .uuid program <http://tables/program.html>.uuid 
> program_workflow<http://tables/program_workflow.html>
>    .uuid program_workflow_state<http://tables/program_workflow_state.html>
>    .uuid relationship <http://tables/relationship.html>.uuid
>    relationship_type <http://tables/relationship_type.html>.uuid
>    report_object <http://tables/report_object.html>.uuid 
> report_schema_xml<http://tables/report_schema_xml.html>
>    .uuid role <http://tables/role.html>.uuid 
> serialized_object<http://tables/serialized_object.html>
>    .uuid 55 instances of anomaly detected
>
>    - *Tables that contain a single column:*
>    Anomaly not detected
>
>    - *Tables with incrementing column names, potentially indicating
>    denormalization:* Table location <http://tables/location.html>
>    person_address <http://tables/person_address.html> 
> person_name<http://tables/person_name.html> 3
>    instances of anomaly detected
>
>    - *Columns whose default value is the word 'NULL' or 'null', but the
>    SQL NULL value may have been intended:*
>    Anomaly not detected
>
>
> On Thu, Jan 19, 2012 at 7:27 PM, Darius Jazayeri <[email protected]>wrote:
>
>> Hi Kishore,
>>
>> Sounds cool. Can you give a couple examples of the sorts of anomalies?
>>
>> -Darius (by phone)
>> On Jan 19, 2012 4:26 AM, "Harsha Siriwardena" <[email protected]>
>> wrote:
>>
>>> thx bro!
>>>
>>> On Thu, Jan 19, 2012 at 2:31 PM, Yekkanti Kishore Kumar <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>> I've  always didn't understood the complete (db)schema structure of
>>>> OpenMRS. Schema Spy <http://schemaspy.sourceforge.net/> helped me in
>>>> understand the db schema better.
>>>> It also gave a list of anomalies in the database which we might need to
>>>> consider. Starting up with Schema Spy is very easy. Just download the jar,
>>>> point it to your database and thats it.
>>>>
>>>> I'm unable to attach the report generated as it is more than 25Mb
>>>> (close to 30MB).
>>>> *Command I used: * *java -jar schemaSpy_5.0.0.jar -t mysql -host
>>>> localhost -dp ~/Desktop/mysql-connector-java-5.1.7-bin.jar -db openmrs -u
>>>> root -p password -o ~/Desktop*
>>>>
>>>> --
>>>> Regards,
>>>> Kishore Kumar Yekkanti.
>>>>  ------------------------------
>>>> Click here to 
>>>> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from
>>>>  OpenMRS Developers' mailing list
>>>
>>>
>>> ------------------------------
>>> Click here to 
>>> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from 
>>> OpenMRS Developers' mailing list
>>
>> ------------------------------
>> Click here to 
>> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from 
>> OpenMRS Developers' mailing list
>>
>
>
>
> --
> Regards,
> Kishore Kumar Yekkanti.
>  ------------------------------
> Click here to 
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from 
> OpenMRS Developers' mailing list
>

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-devel-l" in the  body (not 
the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

Reply via email to