1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Regenerate Quickstart SQL

Summary:
One advantage I wanted to get out of T1191 is automated rebuilds of `quickstart.sql`. If they don't actually work, I'd like to know sooner rather than later. We haven't rebuilt in a couple months, so give it a shot.

Ran into two issues:

  - Some very old patches specify overlong keys which don't work if your default charsets are utf8mb4. Shorten these. No real users have applied these in a very long time.
  - Some gymnastics around `corpus` for the new Conpherence search index.

Test Plan:
  - Ran `arc unit --everything`, got clean results.
  - Cost to do a storage upgrade on an empty namespace dropped from ~4s to ~3s.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11454
This commit is contained in:
epriestley 2015-01-22 16:10:26 -08:00
parent ed2a5a9a34
commit 614f911217
7 changed files with 127 additions and 31 deletions

View file

@ -5,8 +5,8 @@ create table {$NAMESPACE}_worker.worker_task (
leaseExpires int unsigned,
priority bigint unsigned not null,
failureCount int unsigned not null,
key(taskClass),
key(leaseOwner),
key(taskClass(128)),
key(leaseOwner(128)),
key(leaseExpires)
);

View file

@ -4,7 +4,7 @@ create table {$NAMESPACE}_repository.repository_commitdata (
authorName varchar(255) not null,
commitMessage longblob not null,
unique key (commitID),
key (authorName)
key (authorName(128))
);
ALTER TABLE {$NAMESPACE}_worker.worker_task drop priority;

View file

@ -15,7 +15,7 @@ CREATE TABLE {$NAMESPACE}_phriction.phriction_content (
KEY (authorPHID),
title VARCHAR(512) NOT NULL,
slug VARCHAR(512) NOT NULL,
KEY (slug),
KEY (slug(128)),
content LONGBLOB NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL

View file

@ -1,6 +1,6 @@
CREATE TABLE {$NAMESPACE}_user.user_nametoken (
token VARCHAR(255) NOT NULL,
userID INT UNSIGNED NOT NULL,
KEY (token),
KEY (token(128)),
key (userID)
) ENGINE=InnoDB;

View file

@ -1,2 +1,2 @@
ALTER TABLE {$NAMESPACE}_herald.herald_rule ADD ruleType varchar(255) not null DEFAULT 'global';
CREATE INDEX IDX_RULE_TYPE on {$NAMESPACE}_herald.herald_rule (ruleType);
CREATE INDEX IDX_RULE_TYPE on {$NAMESPACE}_herald.herald_rule (ruleType(128));

File diff suppressed because one or more lines are too long

View file

@ -83,10 +83,11 @@ final class PhabricatorStorageManagementQuickstartWorkflow
$dump);
// NOTE: This is a hack. We can not use `binary` for these columns, because
// they are a part of a fulltext index.
// they are a part of a fulltext index. This regex is avoiding matching a
// possible NOT NULL at the end of the line.
$old = $dump;
$dump = preg_replace(
'/`corpus` longtext CHARACTER SET .* COLLATE .*,/mi',
'/`corpus` longtext CHARACTER SET .*? COLLATE \S+,/mi',
'`corpus` longtext CHARACTER SET {$CHARSET_FULLTEXT} '.
'COLLATE {$COLLATE_FULLTEXT},',
$dump);