-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a namespace field to tuf metadata storage
Signed-off-by: Evan Cordell <cordell.evan@gmail.com>
- Loading branch information
Showing
27 changed files
with
422 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE `namespaces` ( | ||
`name` VARCHAR(255) NOT NULL, | ||
PRIMARY KEY (`name`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
INSERT INTO `namespaces` VALUES ("default"); | ||
|
||
ALTER TABLE `tuf_files` | ||
ADD COLUMN `namespace` VARCHAR(255) DEFAULT "default", | ||
ADD FOREIGN KEY (`namespace`) REFERENCES `namespaces`(`name`), | ||
DROP INDEX `gun`, | ||
ADD UNIQUE KEY `gun` (`gun`,`role`,`version`, `namespace`); | ||
|
||
ALTER TABLE `changefeed` | ||
ADD COLUMN `namespace` VARCHAR(255) DEFAULT "default", | ||
ADD FOREIGN KEY (`namespace`) REFERENCES `namespaces`(`name`), | ||
DROP INDEX `idx_changefeed_gun`, | ||
ADD INDEX `idx_changefeed_gun` (`gun`, `namespace`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CREATE TABLE "namespaces" ( | ||
"name" VARCHAR(255) NOT NULL PRIMARY KEY | ||
); | ||
INSERT INTO namespaces (name) VALUES ('default'); | ||
|
||
ALTER TABLE "tuf_files" | ||
ADD COLUMN "namespace" VARCHAR(255) NOT NULL DEFAULT ('default') REFERENCES "namespaces"("name"), | ||
DROP CONSTRAINT "tuf_files_gun_role_version_key", | ||
ADD UNIQUE ("gun","role","version", "namespace"); | ||
|
||
|
||
ALTER TABLE "changefeed" | ||
ADD COLUMN "namespace" VARCHAR(255) NOT NULL DEFAULT ('default') REFERENCES "namespaces"("name"); | ||
|
||
DROP INDEX "idx_changefeed_gun"; | ||
CREATE INDEX "idx_changefeed_gun_ns" ON "changefeed" ("gun", "namespace"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.