Skip to content

Commit

Permalink
Create x_accounts-update.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
andykimpe committed Jun 25, 2014
1 parent 60f75a5 commit 5d3fee3
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Update SQL for CentOS 6 ZPanel 10.0.1 to 10.0.2 */
/* Adds the new fields for account password changes */
DELIMITER $$

USE `zpanel_core`; $$

DROP PROCEDURE IF EXISTS AddColumnUnlessExists $$
CREATE PROCEDURE AddColumnUnlessExists()
BEGIN

-- add a column safely
IF NOT EXISTS( (SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='zpanel_core'
AND COLUMN_NAME='ac_passsalt_vc' AND TABLE_NAME='x_accounts') ) THEN
ALTER TABLE `x_accounts`
ADD COLUMN `ac_passsalt_vc` VARCHAR(22)
NULL DEFAULT NULL AFTER `ac_resethash_tx`;
END IF;

END $$

CALL AddColumnUnlessExists() $$
DROP PROCEDURE IF EXISTS AddColumnUnlessExists $$
DELIMITER ;

0 comments on commit 5d3fee3

Please sign in to comment.