-
Notifications
You must be signed in to change notification settings - Fork 447
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
Conversation
There was a problem hiding this 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?
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. |
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; |
There was a problem hiding this comment.
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.
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`; |
There was a problem hiding this comment.
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`; |
There was a problem hiding this comment.
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`; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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`; |
There was a problem hiding this comment.
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`; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this edited?
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. |
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
How Has This Been Tested?
Checklist: