-
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.
Change Namespaces to Channels, many-to-many with TUFFiles
- Loading branch information
Showing
32 changed files
with
642 additions
and
419 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
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,23 @@ | ||
{ | ||
"server": { | ||
"http_addr": ":4443", | ||
"tls_key_file": "./notary-server.key", | ||
"tls_cert_file": "./notary-server.crt" | ||
}, | ||
"trust_service": { | ||
"type": "remote", | ||
"hostname": "notarysigner", | ||
"port": "7899", | ||
"tls_ca_file": "./root-ca.crt", | ||
"key_algorithm": "ecdsa", | ||
"tls_client_cert": "./notary-server.crt", | ||
"tls_client_key": "./notary-server.key" | ||
}, | ||
"logging": { | ||
"level": "debug" | ||
}, | ||
"storage": { | ||
"backend": "sqlite3", | ||
"db_url": "/tmp/notary-server.db" | ||
} | ||
} |
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,27 @@ | ||
ALTER TABLE `tuf_files` | ||
DROP INDEX `gun`; | ||
|
||
CREATE TABLE `channels` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(255) NOT NULL, | ||
`created_at` timestamp NULL DEFAULT NULL, | ||
`updated_at` timestamp NULL DEFAULT NULL, | ||
`deleted_at` timestamp NULL DEFAULT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
INSERT INTO `channels` (id, name) VALUES (1, "published"), (2, "staged"); | ||
|
||
CREATE TABLE `channels_tuf_files` ( | ||
`channel_id` INT(11) NOT NULL, | ||
`tuf_file_id` INT(11) NOT NULL, | ||
FOREIGN KEY (channel_id) REFERENCES channels(`id`) ON DELETE CASCADE, | ||
FOREIGN KEY (tuf_file_id) REFERENCES tuf_files(`id`) ON DELETE CASCADE, | ||
PRIMARY KEY (tuf_file_id, channel_id) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
INSERT INTO `channels_tuf_files` (channel_id, tuf_file_id) ( | ||
SELECT 1, `id` FROM `tuf_files` | ||
); | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,11 +1,25 @@ | ||
ALTER TABLE "tuf_files" | ||
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 "tuf_files" DROP CONSTRAINT "tuf_files_gun_role_version_key"; | ||
|
||
CREATE TABLE "channels" ( | ||
"id" serial PRIMARY KEY, | ||
"name" VARCHAR(255) NOT NULL, | ||
"created_at" timestamp NULL DEFAULT NULL, | ||
"updated_at" timestamp NULL DEFAULT NULL, | ||
"deleted_at" timestamp NULL DEFAULT NULL | ||
); | ||
|
||
INSERT INTO "channels" (id, name) VALUES (1, 'published'), (2, 'staged'); | ||
|
||
CREATE TABLE "channels_tuf_files" ( | ||
"channel_id" integer NOT NULL, | ||
"tuf_file_id" integer NOT NULL, | ||
FOREIGN KEY (channel_id) REFERENCES channels("id") ON DELETE CASCADE, | ||
FOREIGN KEY (tuf_file_id) REFERENCES tuf_files("id") ON DELETE CASCADE, | ||
PRIMARY KEY (tuf_file_id, channel_id) | ||
); | ||
|
||
INSERT INTO "channels_tuf_files" (channel_id, tuf_file_id) ( | ||
SELECT 1, "id" FROM "tuf_files" | ||
); | ||
|
||
ALTER TABLE "changefeed" | ||
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.