1
0
mirror of https://github.com/docker/docs.git synced 2026-11-06 12:54:24 +03:00
Files
docs/notarymysql/migrate-notaryserver.sql
HuKeping 91d66f5e7a [PATHC 3/4] Only create the needed tables
Make database notaryserver and notarysigner only create the tables they
need.

The signer only needs the private_keys table, and the server only needs
the timestamp_keys and tuf_files tables.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-01-29 10:10:25 +08:00

21 lines
889 B
SQL

-- This migrates initial-notaryserver.sql to tables that are needed for GORM
ALTER TABLE `tuf_files`
ADD COLUMN `created_at` timestamp NULL DEFAULT NULL AFTER `id`,
ADD COLUMN `updated_at` timestamp NULL DEFAULT NULL AFTER `created_at`,
ADD COLUMN `deleted_at` timestamp NULL DEFAULT NULL AFTER `updated_at`,
MODIFY `id` int(10) unsigned AUTO_INCREMENT;
ALTER TABLE `timestamp_keys`
ADD COLUMN `id` int(10) unsigned AUTO_INCREMENT FIRST,
ADD COLUMN `created_at` timestamp NULL DEFAULT NULL AFTER `id`,
ADD COLUMN `updated_at` timestamp NULL DEFAULT NULL AFTER `created_at`,
ADD COLUMN `deleted_at` timestamp NULL DEFAULT NULL AFTER `updated_at`,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`id`),
ADD UNIQUE (`gun`);
ALTER TABLE `timestamp_keys` ADD COLUMN `role` VARCHAR(255) NOT NULL, DROP KEY `gun`, ADD UNIQUE KEY `gun_role` (`gun`, `role`);
UPDATE `timestamp_keys` SET `role`="timestamp";