1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00
phorge-phorge/resources/sql/patches/20131205.buildtargets.sql
James Rhodes 53250d84df Introduce HarbormasterBuildTarget to snapshot build steps through a build
Summary: This implements build targets as outlined in D7582.  Build targets represent an instance of a build step particular to the build.  Logs and artifacts have been adjusted to attach to build targets instead of build / build step pairs.

Test Plan: Ran builds and clicked around the interface.  Everything seemed to work.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T4111, T1049

Differential Revision: https://secure.phabricator.com/D7703
2013-12-05 12:01:12 +11:00

32 lines
1.3 KiB
SQL

CREATE TABLE {$NAMESPACE}_harbormaster.harbormaster_buildtarget (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
buildPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
buildStepPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
className VARCHAR(255) NOT NULL COLLATE utf8_bin,
details LONGTEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
variables LONGTEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
KEY `key_build` (buildPHID, buildStepPHID),
UNIQUE KEY `key_phid` (phid)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
TRUNCATE TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlog;
TRUNCATE TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlogchunk;
TRUNCATE TABLE {$NAMESPACE}_harbormaster.harbormaster_buildartifact;
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlog
DROP COLUMN buildPHID;
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlog
DROP COLUMN buildStepPHID;
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildartifact
DROP COLUMN buildablePHID;
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlog
ADD COLUMN buildTargetPHID VARCHAR(64) NOT NULL COLLATE utf8_bin;
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildartifact
ADD COLUMN buildTargetPHID VARCHAR(64) NOT NULL COLLATE utf8_bin;