CREATE TABLE IF NOT EXISTS OrgUserDefaultQuota (
  id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  org_id INTEGER,
  quota BIGINT, UNIQUE INDEX(org_id)
) ENGINE=INNODB;

CREATE TABLE IF NOT EXISTS OrgDownloadRateLimit (
  id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  org_id INTEGER,
  download_limit BIGINT,
  UNIQUE INDEX(org_id)
) ENGINE=INNODB;

CREATE TABLE IF NOT EXISTS OrgUploadRateLimit (
  id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  org_id INTEGER,
  upload_limit BIGINT,
  UNIQUE INDEX(org_id)
) ENGINE=INNODB;

ALTER TABLE RepoInfo ADD COLUMN type varchar(10);
CREATE INDEX RepoInfoTypeIndex on RepoInfo (type);
