mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 03:12:41 +01:00
d32926e5f7
Summary: See discussion in D3078 for why I've separated this. Pretty sure it's not quite ready yet -- I want to build a couple of things on it so we have a better idea of what we need (autoincrement ID? <factType, objectA, epoch> primary key? objectB column? valueZ?) and don't need to do a ton of schema patches. Test Plan: Applied patches, ran D3078. Reviewers: vrana, btrahan, majak Reviewed By: vrana CC: aran Maniphest Tasks: T1581, T1562 Differential Revision: https://secure.phabricator.com/D3088
28 lines
1.1 KiB
SQL
28 lines
1.1 KiB
SQL
CREATE TABLE {$NAMESPACE}_fact.fact_raw (
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
`factType` VARCHAR(32) NOT NULL COLLATE utf8_bin,
|
|
`objectPHID` VARCHAR(64) NOT NULL COLLATE utf8_bin,
|
|
`objectA` VARCHAR(64) NOT NULL COLLATE utf8_bin,
|
|
`valueX` BIGINT NOT NULL,
|
|
`valueY` BIGINT NOT NULL,
|
|
`epoch` INT UNSIGNED NOT NULL,
|
|
KEY (objectPHID),
|
|
KEY (factType, epoch),
|
|
KEY (factType, objectA, epoch)
|
|
) ENGINE=InnoDB, COLLATE utf8_general_ci;
|
|
|
|
CREATE TABLE {$NAMESPACE}_fact.fact_aggregate (
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
`factType` VARCHAR(32) NOT NULL COLLATE utf8_bin,
|
|
`objectPHID` VARCHAR(64) NOT NULL COLLATE utf8_bin,
|
|
`valueX` BIGINT NOT NULL,
|
|
UNIQUE KEY (factType, objectPHID),
|
|
KEY (factType, valueX)
|
|
) ENGINE=InnoDB, COLLATE utf8_general_ci;
|
|
|
|
CREATE TABLE {$NAMESPACE}_fact.fact_cursor (
|
|
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
`name` VARCHAR(64) NOT NULL COLLATE utf8_bin,
|
|
`position` VARCHAR(64) NOT NULL COLLATE utf8_bin,
|
|
UNIQUE KEY (name)
|
|
) ENGINE=InnoDB, COLLATE utf8_general_ci;
|