Skip to content

Commit

Permalink
Merge pull request #204 from nsacyber/issue-203
Browse files Browse the repository at this point in the history
[#203] New version 1.1.1 for release
  • Loading branch information
chubtub authored Nov 21, 2019
2 parents 09aafa8 + ad3aa1a commit 0c2005c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.1.1
12 changes: 11 additions & 1 deletion package/rpm/HIRS.spec
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,22 @@ if [ $1 -gt 1 ]; then
exit 1;
fi
elif [ %{version} == "1.1.0" ]; then
if (mysql -u root hirs_db < /opt/hirs/scripts/common/upgrade_schema_1.0.4.sql && mysql -u root hirs_db < /opt/hirs/scripts/common/upgrade_schema_1.1.0.sql); then
if (mysql -u root hirs_db < /opt/hirs/scripts/common/upgrade_schema_1.0.4.sql && \
mysql -u root hirs_db < /opt/hirs/scripts/common/upgrade_schema_1.1.0.sql); then
echo "Upgrade to version 1.1.0"
else
echo "Error upgrading HIRS database schema to 1.1.0!"
exit 1;
fi
elif [ %{version} == "1.1.1" ]; then
if (mysql -u root hirs_db < /opt/hirs/scripts/common/upgrade_schema_1.0.4.sql && \
mysql -u root hirs_db < /opt/hirs/scripts/common/upgrade_schema_1.1.0.sql && \
mysql -u root hirs_db < /opt/hirs/scripts/common/upgrade_schema_1.1.1.sql); then
echo "Upgrade to version 1.1.1"
else
echo "Error upgrading HIRS database schema to 1.1.1!"
exit 1;
fi
fi
fi

Expand Down
23 changes: 23 additions & 0 deletions package/scripts/common/upgrade_schema_1.1.1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
DROP PROCEDURE IF EXISTS upgrade_schema_to_1_1_1;
DELIMITER '//'

CREATE PROCEDURE upgrade_schema_to_1_1_1()
BEGIN
IF(NOT EXISTS(SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='hirs_db' AND TABLE_NAME='Certificate' AND COLUMN_NAME='tcgCredentialMajorVersion')) THEN
ALTER TABLE Certificate ADD tcgCredentialMajorVersion int(11) DEFAULT NULL;
END IF;

IF(NOT EXISTS(SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='hirs_db' AND TABLE_NAME='Certificate' AND COLUMN_NAME='tcgCredentialMinorVersion')) THEN
ALTER TABLE Certificate ADD tcgCredentialMinorVersion int(11) DEFAULT NULL;
END IF;

IF(NOT EXISTS(SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='hirs_db' AND TABLE_NAME='Certificate' AND COLUMN_NAME='tcgCredentialRevisionLevel')) THEN
ALTER TABLE Certificate ADD tcgCredentialRevisionLevel int(11) DEFAULT NULL;
END IF;

END//
DELIMITER ';'

CALL upgrade_schema_to_1_1_1;
DROP PROCEDURE upgrade_schema_to_1_1_1;

0 comments on commit 0c2005c

Please sign in to comment.