-
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.
Remove namespaces table and more descriptive naming
Signed-off-by: Evan Cordell <cordell.evan@gmail.com>
- Loading branch information
Showing
20 changed files
with
158 additions
and
172 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 |
---|---|---|
@@ -1,18 +1,9 @@ | ||
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`), | ||
ADD COLUMN `namespace` VARCHAR(255) DEFAULT "published", | ||
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`), | ||
ADD COLUMN `namespace` VARCHAR(255) DEFAULT "published", | ||
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 |
---|---|---|
@@ -1,16 +1,11 @@ | ||
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"), | ||
ADD COLUMN "namespace" VARCHAR(255) NOT NULL DEFAULT ('published'), | ||
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"); | ||
ADD COLUMN "namespace" VARCHAR(255) NOT NULL DEFAULT ('published'); | ||
|
||
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.