1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00
phorge-phorge/resources/sql/patches/088.audit.sql
epriestley f30f4fa713 Issue CREATE DATABASE before ALTER TABLE in patch 88
Summary:
Sometimes the SQL account may not have CREATE DATABASE privileges, so try to
fail this script immediately rather than having it work halfway if the
permission is missing.

This is just a minor tweak to try to slightly improve some cases, the long term
fix is T345 but that's a good deal more work than this.

Test Plan: Visually inspected patch; trivial change.

Reviewers: jungejason, btrahan, skrul

Reviewed By: skrul

CC: aran, skrul

Differential Revision: https://secure.phabricator.com/D1287
2011-12-27 17:50:23 -08:00

23 lines
1,013 B
SQL

CREATE DATABASE IF NOT EXISTS phabricator_audit;
ALTER TABLE phabricator_owners.owners_packagecommitrelationship
ADD COLUMN `auditStatus` varchar(64) NOT NULL,
ADD COLUMN `auditReasons` longtext NOT NULL,
DROP KEY `packagePHID`,
ADD KEY `packagePHID` (`packagePHID`, `auditStatus`, `id`);
CREATE TABLE IF NOT EXISTs phabricator_audit.audit_comment (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
`targetPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
`actorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
`dateCreated` int(10) unsigned NOT NULL,
`dateModified` int(10) unsigned NOT NULL,
`action` varchar(64) NOT NULL,
`content` longtext NOT NULL,
PRIMARY KEY `id` (`id`),
KEY `targetPHID` (`targetPHID`, `actorPHID`, `id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE phabricator_owners.owners_package
ADD COLUMN `auditingEnabled` tinyint(1) NOT NULL DEFAULT 0;