<?xml version="1.0" encoding="UTF-8"?>
<update>
    <step id="10">UPDATE %PREFIX%_preferences SET prf_value = '3' WHERE prf_name = 'max_file_upload_size'</step>
    <step id="20">UPDATE %PREFIX%_preferences SET prf_value = '1' WHERE prf_name = 'max_email_attachment_size'</step>
    <step id="30" database="mysql">ALTER TABLE %PREFIX%_users MODIFY COLUMN usr_password varchar(255)</step>
    <step id="40" database="mysql">ALTER TABLE %PREFIX%_users MODIFY COLUMN usr_new_password varchar(255)</step>
    <step id="50" database="pgsql">ALTER TABLE %PREFIX%_users ALTER COLUMN usr_password TYPE varchar(255)</step>
    <step id="60" database="pgsql">ALTER TABLE %PREFIX%_users ALTER COLUMN usr_new_password TYPE varchar(255)</step>
    <step id="70">UPDATE %PREFIX%_user_fields SET usf_type = 'PHONE' WHERE usf_name_intern IN ('PHONE', 'MOBILE', 'FAX')</step>
    <step id="80">UpdateStepsCode::updateStep31SetDefaultConfiguration</step>
    <step id="90">ALTER TABLE %PREFIX%_lists DROP COLUMN lst_default</step>
    <step id="100">ALTER TABLE %PREFIX%_announcements ADD COLUMN ann_org_id integer unsigned</step>
    <step id="110">UPDATE %PREFIX%_announcements SET ann_org_id = (SELECT org_id FROM %PREFIX%_organizations WHERE org_shortname = ann_org_shortname) WHERE ann_org_shortname IS NOT NULL</step>
    <step id="112" database="mysql">ALTER TABLE %PREFIX%_announcements MODIFY COLUMN ann_org_id integer unsigned NOT NULL</step>
    <step id="115" database="pgsql">ALTER TABLE %PREFIX%_announcements ALTER COLUMN ann_org_id SET NOT NULL</step>
    <step id="120" database="mysql" error="ignore">ALTER TABLE %PREFIX%_announcements DROP FOREIGN KEY %PREFIX%_FK_ANN_ORG</step>
    <step id="130" database="mysql" error="ignore">ALTER TABLE %PREFIX%_announcements DROP INDEX %PREFIX%_FK_ANN_ORG</step>
    <step id="140" database="mysql" error="ignore">ALTER TABLE %PREFIX%_announcements DROP INDEX ANN_ORG_FK</step>
    <step id="150" database="pgsql">ALTER TABLE %PREFIX%_announcements DROP CONSTRAINT %PREFIX%_FK_ANN_ORG</step>
    <step id="160">ALTER TABLE %PREFIX%_announcements DROP COLUMN ann_org_shortname</step>
    <step id="170">ALTER TABLE %PREFIX%_announcements ADD CONSTRAINT %PREFIX%_FK_ANN_ORG FOREIGN KEY (ann_org_id) REFERENCES %PREFIX%_organizations (org_id) on delete restrict on update restrict</step>
    <step id="180">ALTER TABLE %PREFIX%_photos ADD COLUMN pho_org_id integer unsigned</step>
    <step id="190">UPDATE %PREFIX%_photos SET pho_org_id = (SELECT org_id FROM %PREFIX%_organizations WHERE org_shortname = pho_org_shortname) WHERE pho_org_shortname IS NOT NULL</step>
    <step id="192" database="mysql">ALTER TABLE %PREFIX%_photos MODIFY COLUMN pho_org_id integer unsigned NOT NULL</step>
    <step id="195" database="pgsql">ALTER TABLE %PREFIX%_photos ALTER COLUMN pho_org_id SET NOT NULL</step>
    <step id="200" database="mysql" error="ignore">ALTER TABLE %PREFIX%_photos DROP FOREIGN KEY %PREFIX%_FK_PHO_ORG</step>
    <step id="210" database="mysql" error="ignore">ALTER TABLE %PREFIX%_photos DROP INDEX %PREFIX%_FK_PHO_ORG</step>
    <step id="215" database="mysql" error="ignore">ALTER TABLE %PREFIX%_photos DROP INDEX PHO_ORG_FK</step>
    <step id="220" database="pgsql">ALTER TABLE %PREFIX%_photos DROP CONSTRAINT %PREFIX%_FK_PHO_ORG</step>
    <step id="240">ALTER TABLE %PREFIX%_photos DROP COLUMN pho_org_shortname</step>
    <step id="250">ALTER TABLE %PREFIX%_photos ADD CONSTRAINT %PREFIX%_FK_PHO_ORG FOREIGN KEY (pho_org_id) REFERENCES %PREFIX%_organizations (org_id) on delete restrict on update restrict</step>
    <step id="260" database="mysql">UPDATE %PREFIX%_preferences pr1 INNER JOIN %PREFIX%_preferences pr2 ON pr2.prf_name = 'dates_viewmode' SET pr1.prf_value = pr2.prf_value WHERE pr1.prf_name = 'dates_view'</step>
    <step id="270" database="pgsql">UPDATE %PREFIX%_preferences pr1 SET prf_value = pr2.prf_value FROM %PREFIX%_preferences pr2 WHERE pr2.prf_name = 'dates_viewmode' AND pr1.prf_name = 'dates_view'</step>
    <step id="280">DELETE FROM %PREFIX%_preferences WHERE prf_name = 'dates_viewmode'</step>
    <step id="290">UPDATE %PREFIX%_preferences SET prf_value = 'detail' WHERE prf_name = 'dates_view' AND prf_value = 'html'</step>
    <step id="300">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%organization_long_name%', '#organization_long_name#')</step>
    <step id="310">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%user_first_name%', '#user_first_name#')</step>
    <step id="320">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%user_last_name%', '#user_last_name#')</step>
    <step id="330">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%user_login_name%', '#user_login_name#')</step>
    <step id="340">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%user_email%', '#user_email#')</step>
    <step id="350">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%webmaster_email%', '#webmaster_email#')</step>
    <step id="360">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%organization_short_name%', '#organization_short_name#')</step>
    <step id="370">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%organization_homepage%', '#organization_homepage#')</step>
    <step id="380">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%variable1%', '#variable1#')</step>
    <step id="390">UPDATE %PREFIX%_texts SET txt_text = REPLACE(txt_text, '%variable2%', '#variable2#')</step>
    <step id="400">UPDATE %PREFIX%_user_fields SET usf_url = REPLACE(usf_url, '%user_content%', '#user_content#') WHERE usf_url LIKE '%user_content%'</step>
    <step id="410">TRUNCATE TABLE %PREFIX%_auto_login</step>
    <step id="420">ALTER TABLE %PREFIX%_auto_login ADD COLUMN atl_auto_login_id varchar(255) not null</step>
    <step id="430">ALTER TABLE %PREFIX%_auto_login ADD COLUMN atl_number_invalid smallint not null DEFAULT 0</step>
    <step id="440" database="mysql">ALTER TABLE %PREFIX%_auto_login MODIFY COLUMN atl_session_id varchar(255) NOT NULL</step>
    <step id="450" database="pgsql">ALTER TABLE %PREFIX%_auto_login ALTER COLUMN atl_session_id TYPE varchar(255)</step>
    <step id="460" database="mysql">ALTER TABLE %PREFIX%_guestbook MODIFY COLUMN gbo_email varchar(254)</step>
    <step id="470" database="pgsql">ALTER TABLE %PREFIX%_guestbook ALTER COLUMN gbo_email TYPE varchar(254)</step>
    <step id="480" database="mysql">ALTER TABLE %PREFIX%_guestbook_comments MODIFY COLUMN gbc_email varchar(254)</step>
    <step id="490" database="pgsql">ALTER TABLE %PREFIX%_guestbook_comments ALTER COLUMN gbc_email TYPE varchar(254)</step>
    <step id="500">ALTER TABLE %PREFIX%_sessions DROP COLUMN ses_device_id</step>
    <step>stop</step>
</update>
