1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00
phorge-phorge/resources/sql/patches/20130519.diviner.sql
epriestley b0a5f42244 Add "live" publisher and storage to Diviner
Summary:
Ref T988. This adds basics for the non-static publishing target:

  - Storage (called "Live", e.g. `DivinerLiveAtom` to distinguish it from shared classes like `DivinerAtom`).
  - Mostly populate the storage.
  - Some minor fixes and improvements.

Test Plan: Generated docs, looked at DB, saw mostly-sensible output.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D5973
2013-05-20 10:18:26 -07:00

38 lines
1.4 KiB
SQL

CREATE TABLE {$NAMESPACE}_diviner.diviner_livebook (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
name VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY (name),
UNIQUE KEY (phid)
) ENGINE=InnoDB, DEFAULT CHARSET = utf8;
CREATE TABLE {$NAMESPACE}_diviner.diviner_livesymbol (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
bookPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
context VARCHAR(255) COLLATE utf8_bin,
type VARCHAR (32) NOT NULL COLLATE utf8_bin,
name VARCHAR (255) NOT NULL COLLATE utf8_bin,
atomIndex INT UNSIGNED NOT NULL,
identityHash VARCHAR(12) NOT NULL COLLATE utf8_bin,
graphHash VARCHAR(33) COLLATE utf8_bin,
KEY (bookPHID, type, name(64), context(64), atomIndex),
KEY (name),
UNIQUE KEY (graphHash),
UNIQUE KEY (identityHash),
UNIQUE KEY (phid)
) ENGINE=InnoDB, DEFAULT CHARSET = utf8;
CREATE TABLE {$NAMESPACE}_diviner.diviner_liveatom (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
symbolPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
content LONGTEXT NOT NULL COLLATE utf8_bin,
atomData LONGTEXT NOT NULL COLLATE utf8_bin,
UNIQUE KEY (symbolPHID)
) ENGINE=InnoDB, DEFAULT CHARSET = utf8;