mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-24 07:41:40 +01:00
Merge pull request #6488 from wy65701436/fix-update-notary
Fix unable to use Notary after updating to v1.6.0
This commit is contained in:
commit
205e85b2b2
@ -0,0 +1,8 @@
|
||||
\c notaryserver;
|
||||
|
||||
ALTER TABLE tuf_files OWNER TO server;
|
||||
ALTER SEQUENCE tuf_files_id_seq OWNER TO server;
|
||||
ALTER TABLE change_category OWNER TO server;
|
||||
ALTER TABLE changefeed OWNER TO server;
|
||||
ALTER SEQUENCE changefeed_id_seq OWNER TO server;
|
||||
ALTER TABLE schema_migrations OWNER TO server;
|
@ -1,7 +1,7 @@
|
||||
\c notaryserver;
|
||||
|
||||
CREATE TABLE "tuf_files" (
|
||||
"id" int PRIMARY KEY,
|
||||
"id" serial PRIMARY KEY,
|
||||
"created_at" timestamp NULL DEFAULT NULL,
|
||||
"updated_at" timestamp NULL DEFAULT NULL,
|
||||
"deleted_at" timestamp NULL DEFAULT NULL,
|
||||
|
@ -0,0 +1,5 @@
|
||||
\c notarysigner;
|
||||
|
||||
ALTER TABLE private_keys OWNER TO signer;
|
||||
ALTER SEQUENCE private_keys_id_seq OWNER TO signer;
|
||||
ALTER TABLE schema_migrations OWNER TO signer;
|
@ -1,7 +1,7 @@
|
||||
\c notarysigner;
|
||||
|
||||
CREATE TABLE "private_keys" (
|
||||
"id" int PRIMARY KEY,
|
||||
"id" serial PRIMARY KEY,
|
||||
"created_at" timestamp NULL DEFAULT NULL,
|
||||
"updated_at" timestamp NULL DEFAULT NULL,
|
||||
"deleted_at" timestamp NULL DEFAULT NULL,
|
||||
|
@ -73,8 +73,11 @@ EOF
|
||||
# launch_pgsql $PGSQL_USR
|
||||
psql -U $1 -f /harbor-migration/db/schema/notaryserver_create_tables.pgsql
|
||||
psql -U $1 -f /harbor-migration/db/schema/notaryserver_insert_data.pgsql
|
||||
psql -U $1 -f /harbor-migration/db/schema/notaryserver_alter_tables.pgsql
|
||||
|
||||
psql -U $1 -f /harbor-migration/db/schema/notarysigner_create_tables.pgsql
|
||||
psql -U $1 -f /harbor-migration/db/schema/notarysigner_insert_data.pgsql
|
||||
psql -U $1 -f /harbor-migration/db/schema/notarysigner_alter_tables.pgsql
|
||||
|
||||
stop_mysql root
|
||||
stop_pgsql $1
|
||||
|
@ -95,6 +95,7 @@ def convert_notary_server_db(mysql_dump_file, pgsql_dump_file):
|
||||
write_database(pgsql_dump, "notaryserver")
|
||||
write_insert(pgsql_dump, insert_lines)
|
||||
write_sequence(pgsql_dump, "tuf_files", "id")
|
||||
write_sequence(pgsql_dump, "changefeed", "id")
|
||||
|
||||
def convert_notary_signer_db(mysql_dump_file, pgsql_dump_file):
|
||||
mysql_dump = open(mysql_dump_file)
|
||||
@ -144,7 +145,7 @@ def write_alter_table_bool(pgsql_dump, table_name, table_columnn, default_value=
|
||||
|
||||
def write_sequence(pgsql_dump, table_name, table_columnn):
|
||||
pgsql_dump.write('\n')
|
||||
pgsql_dump.write("CREATE SEQUENCE %s_%s_seq;\n" % (table_name, table_columnn))
|
||||
pgsql_dump.write("CREATE SEQUENCE IF NOT EXISTS %s_%s_seq;\n" % (table_name, table_columnn))
|
||||
pgsql_dump.write("SELECT setval('%s_%s_seq', max(%s)) FROM %s;\n" % (table_name, table_columnn, table_columnn, table_name))
|
||||
pgsql_dump.write("ALTER TABLE \"%s\" ALTER COLUMN \"%s\" SET DEFAULT nextval('%s_%s_seq');\n" % (table_name, table_columnn, table_name, table_columnn))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user