Skip to content

Commit

Permalink
ZCS-11064: add migration script for zimbra.zmg_devices table
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeprashant committed Nov 16, 2021
1 parent 7dbb55e commit d9e9342
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/db/migration/migrate20211116-ZmgDevices.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/perl
#
# ***** BEGIN LICENSE BLOCK *****
# Zimbra Collaboration Suite Server
# Copyright (C) 2015, 2016 Synacor, Inc.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software Foundation,
# version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
# ***** END LICENSE BLOCK *****
#


use strict;
use Migrate;

Migrate::verifySchemaVersion(114);

my $sqlStmt = <<_SQL_;
ALTER TABLE zmg_devices DROP PRIMARY KEY;
ALTER TABLE zmg_devices ADD CONSTRAINT PK_zmg_devices PRIMARY KEY (mailbox_id, reg_id);
ALTER TABLE zmg_devices ADD COLUMN send_mail_notification TINYINT(1) DEFAULT 1;
ALTER TABLE zmg_devices ADD COLUMN send_reminder_notification TINYINT(1) DEFAULT 1;
_SQL_

Migrate::runSql($sqlStmt);

Migrate::updateSchemaVersion(114, 115);

exit(0);

0 comments on commit d9e9342

Please sign in to comment.