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

Update upgrade process to support churchinfo 1.3.1 #6896

Merged
merged 3 commits into from
Mar 13, 2024
Merged

Conversation

DawoudIO
Copy link
Contributor

Description & Issue number it closes

We only supported 1.3.0 of church info for upgrade, this add 1.3.1

Screenshots (if appropriate)

How to test the changes?

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Contributor

@DAcodedBEAT DAcodedBEAT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, just curious if this is tested or a best-effort case?

@DawoudIO
Copy link
Contributor Author

it is not tested, the PR is to help with the person who is stuck and posted a Q... I hope he can share that it worked if not we will keep updating this PR.

@DawoudIO DawoudIO added this to the 5.6.0 milestone Feb 28, 2024
@DAcodedBEAT DAcodedBEAT modified the milestones: 5.6.0, vNext Feb 29, 2024
@DawoudIO DawoudIO modified the milestones: vNext, 6.7.0 Mar 8, 2024
ADD COLUMN `event_publicly_visible` BOOLEAN DEFAULT FALSE AFTER `event_grpid`;
END IF;
ALTER TABLE events_event
ADD COLUMN event_publicly_visible BOOLEAN DEFAULT FALSE AFTER event_grpid;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the IF NOT EXISTS conditional to ensure that the migrations are replayable so users facing upgrade issues can manually re-invoke the sql and not have to investigate every single change to the schema along the way.

Comment on lines +1 to +5
alter table version_ver add `ver_update_start` datetime DEFAULT NULL;

alter table version_ver add `ver_update_end` datetime DEFAULT NULL;

alter table version_ver drop column `ver_date`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the same spirit as #6831 , we should make our migrations replayable to avoid issues on re-run

CALL DropColumnIfExists('user_usr', 'usr_BaseFontSize');
CALL DropColumnIfExists('user_usr', 'usr_Communication');
CALL DropColumnIfExists('user_usr', 'usr_Workspacewidth');
alter table user_usr drop column `usr_BaseFontSize`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this edited?

CALL DropColumnIfExists('config_cfg', 'cfg_data');

DROP PROCEDURE IF EXISTS DropColumnIfExists;
alter table config_cfg drop column `cfg_type`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this edited?


CALL AddColumnIfNotExists('group_grp', 'grp_active', 'BOOLEAN NOT NULL DEFAULT 1 AFTER grp_hasSpecialProps');
CALL AddColumnIfNotExists('group_grp', 'grp_include_email_export', 'BOOLEAN NOT NULL DEFAULT 1 AFTER grp_active');
ALTER TABLE group_grp ADD grp_active BOOLEAN DEFAULT 1 NOT NULL AFTER grp_hasSpecialProps;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this edited?

-- CALL AddColumnIfNotExists('person_per', 'per_FacebookID', 'bigint(20) unsigned default NULL AFTER per_Flags');
CALL AddColumnIfNotExists('person_per', 'per_Twitter', 'varchar(50) default NULL AFTER per_Flags');
CALL AddColumnIfNotExists('person_per', 'per_LinkedIn', 'varchar(50) default NULL AFTER per_Twitter');
ALTER TABLE person_per ADD COLUMN per_Twitter varchar(50) default NULL AFTER per_Flags;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this edited?

CALL AddColumnIfNotExists('events_event', 'primary_contact_person_id', 'INT DEFAULT NULL AFTER `location_id`');
CALL AddColumnIfNotExists('events_event', 'secondary_contact_person_id', 'INT DEFAULT NULL AFTER `primary_contact_person_id`');
CALL AddColumnIfNotExists('events_event', 'event_url', 'text DEFAULT NULL AFTER `secondary_contact_person_id`');
ALTER TABLE events_event ADD COLUMN location_id INT DEFAULT NULL AFTER `event_typename`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this edited?

CALL AddColumnIfNotExists('user_usr', 'usr_TwoFactorAuthRecoveryCodes', 'TEXT NULL AFTER `usr_TwoFactorAuthLastKeyTimestamp');

DROP PROCEDURE IF EXISTS AddColumnIfNotExists;
ALTER TABLE user_usr ADD COLUMN usr_TwoFactorAuthSecret VARCHAR(255) NULL AFTER `usr_Canvasser`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this edited?


/* drop the procedure after usage */
DROP PROCEDURE IF EXISTS DropIndexIfExists;
ALTER TABLE canvassdata_can DROP INDEX can_ID;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this edited?

column_name = 'per_Facebook'
) THEN
ALTER TABLE person_per
ALTER TABLE person_per
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this edited?

@DawoudIO
Copy link
Contributor Author

DawoudIO commented Mar 8, 2024

Main issue is all these functions did not work with our upgrade script, something changes in how we load the SQL from the files and It was faster to move from functions to just standard SQL.

@DawoudIO DawoudIO modified the milestones: 6.7.0, 5.7.0 Mar 8, 2024
@DawoudIO DawoudIO merged commit cc97add into master Mar 13, 2024
4 checks passed
@DawoudIO DawoudIO deleted the churchinfo/1.3.1 branch March 13, 2024 02:18
@DAcodedBEAT DAcodedBEAT added the php Pull requests that update Php code label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Installation / Upgrade php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants