Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix schema support for composite primary keys #20705

Merged
merged 1 commit into from
Jun 24, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jun 24, 2021

Overview

Fix schema support for composite primary keys

Before

We support a primaryKey like

    <primaryKey>
        <name>contact_timestamp_type</name>
        <field>contact_identifier</field>
        <field>recipient_action_datetime</field>
        <field>event_type</field>
    </primaryKey>

but incorrectly add a dummy field for it with just the key 'autoincrement' - by the time it hits the tpl it looks like

+        '' => [
+          'name' => '',
+          'type' => ,
+          'where' => 'civicrm_mailing_provider_data.',
+          'table_name' => 'civicrm_mailing_provider_data',
+          'entity' => 'MailingProviderData',
+          'bao' => 'CRM_Omnimail_DAO_MailingProviderData',
+          'localizable' => 0,
+          'add' => NULL,
+        ],
       ];

After

no dummy key

Technical Details

Fixes what looks like an oversight
022785d#diff-08ba0d294c1f2e5b9d42e4768aa3b30a10e5128809c590f155c5ac0cc9b2f69cL480-L481

An 'if' was added but the uncondition line left in

The result is that if a composite primary field IS defined
per below an entry for it is incorrectly added to the field
array with just autoincrement set.

Comments

Fixes what looks like an oversight
civicrm@022785d#diff-08ba0d294c1f2e5b9d42e4768aa3b30a10e5128809c590f155c5ac0cc9b2f69cL480-L481

An 'if' was added but the uncondition line left in

The result is that if a composite primary field IS defined
per below an entry for it is incorrectly added to the field
array with just autoincrement set.
`
    <primaryKey>
        <name>contact_timestamp_type</name>
        <field>contact_identifier</field>
        <field>recipient_action_datetime</field>
        <field>event_type</field>
    </primaryKey>
`
@civibot
Copy link

civibot bot commented Jun 24, 2021

(Standard links)

@civibot civibot bot added the master label Jun 24, 2021
@seamuslee001
Copy link
Contributor

this seems fine to me

@seamuslee001 seamuslee001 merged commit 1709219 into civicrm:master Jun 24, 2021
@seamuslee001 seamuslee001 deleted the prim branch June 24, 2021 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants