Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: migrate audit_log/query_history/export_archive to UUID PK (#19636)
ecmadao6e7867865c17
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yamlindex 2a59409012..6ff110b2e7 100644--- a/backend/api/mcp/gen/openapi.yaml+++ b/backend/api/mcp/gen/openapi.yaml@@ -14442,7 +14442,7 @@ components:title: namedescription: |-The name for the query history.- Format: queryHistories/{uid}+ Format: projects/{project}/queryHistories/{id}database:type: stringtitle: databasediff --git a/backend/api/v1/audit_log_service.go b/backend/api/v1/audit_log_service.goindex ed6ed8c179..9f17e562d4 100644--- a/backend/api/v1/audit_log_service.go+++ b/backend/api/v1/audit_log_service.go@@ -162,7 +162,7 @@ func convertToAuditLogs(auditLogs []*store.AuditLog) []*v1pb.AuditLog {func convertToAuditLog(l *store.AuditLog) *v1pb.AuditLog {return &v1pb.AuditLog{- Name: fmt.Sprintf("%s/%s%d", l.Payload.Parent, common.AuditLogPrefix, l.ID),+ Name: fmt.Sprintf("%s/%s%s", l.Payload.Parent, common.AuditLogPrefix, l.ResourceID),CreateTime: timestamppb.New(l.CreatedAt),User: l.Payload.User,Method: l.Payload.Method,diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.goindex b32d6fdf89..fa609280e1 100644--- a/backend/api/v1/rollout_service_converter.go+++ b/backend/api/v1/rollout_service_converter.go@@ -56,10 +56,10 @@ func convertToTaskRun(ctx context.Context, s *store.Store, taskRun *store.TaskRut.SchedulerInfo = convertToSchedulerInfo(taskRun.PayloadProto.SchedulerInfo)}- if taskRun.ResultProto.ExportArchiveUid != 0 {+ if taskRun.ResultProto.ExportArchiveId != "" {t.ExportArchiveStatus = v1pb.TaskRun_EXPORTED- exportArchiveUID := int(taskRun.ResultProto.ExportArchiveUid)- exportArchive, err := s.GetExportArchive(ctx, &store.FindExportArchiveMessage{UID: &exportArchiveUID})+ exportArchiveID := taskRun.ResultProto.ExportArchiveId+ exportArchive, err := s.GetExportArchive(ctx, exportArchiveID)if err != nil {return nil, errors.Wrapf(err, "failed to get export archive")}diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.goindex 937d79cf84..e3ef0f0cc2 100644--- a/backend/api/v1/sql_service.go+++ b/backend/api/v1/sql_service.go@@ -939,11 +939,11 @@ func (s *SQLService) doExportFromIssue(ctx context.Context, requestName string)return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("rollout %v has no task run", requestName))}taskRun := taskRuns[0]- exportArchiveUID := int(taskRun.ResultProto.ExportArchiveUid)- if exportArchiveUID == 0 {+ exportArchiveID := taskRun.ResultProto.ExportArchiveId+ if exportArchiveID == "" {return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("issue %v has no export archive", requestName))}- exportArchive, err := s.store.GetExportArchive(ctx, &store.FindExportArchiveMessage{UID: &exportArchiveUID})+ exportArchive, err := s.store.GetExportArchive(ctx, exportArchiveID)if err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get export archive: %v", err))}diff --git a/backend/api/v1/sql_service_converter.go b/backend/api/v1/sql_service_converter.goindex 40a42f46ab..6c5772162d 100644--- a/backend/api/v1/sql_service_converter.go+++ b/backend/api/v1/sql_service_converter.go@@ -56,7 +56,7 @@ func (s *SQLService) convertToV1QueryHistory(ctx context.Context, history *store}return &v1pb.QueryHistory{- Name: fmt.Sprintf("queryHistories/%d", history.UID),+ Name: fmt.Sprintf("%s/queryHistories/%s", common.FormatProject(history.Project), history.ResourceID),Statement: history.Statement,Error: history.Payload.Error,Database: history.Database,diff --git a/backend/generated-go/store/task_run.pb.go b/backend/generated-go/store/task_run.pb.goindex fd741cef58..3239eec994 100644--- a/backend/generated-go/store/task_run.pb.go+++ b/backend/generated-go/store/task_run.pb.go@@ -140,14 +140,14 @@ type TaskRunResult struct {state protoimpl.MessageState `protogen:"open.v1"`// Error message for failed task runs. Empty for successful or canceled runs.Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"`- // UID of the export archive generated for export tasks.- ExportArchiveUid int32 `protobuf:"varint,5,opt,name=export_archive_uid,json=exportArchiveUid,proto3" json:"export_archive_uid,omitempty"`// Indicates whether a prior backup was created for this task run.// When true, the task run can be rolled back using the backup tables.// Backup details are available in the task run logs (PRIOR_BACKUP log entries).HasPriorBackup bool `protobuf:"varint,6,opt,name=has_prior_backup,json=hasPriorBackup,proto3" json:"has_prior_backup,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ // Resource ID of the export archive generated for export tasks.+ ExportArchiveId string `protobuf:"bytes,9,opt,name=export_archive_id,json=exportArchiveId,proto3" json:"export_archive_id,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *TaskRunResult) Reset() {@@ -187,18 +187,18 @@ func (x *TaskRunResult) GetDetail() string {return ""}-func (x *TaskRunResult) GetExportArchiveUid() int32 {+func (x *TaskRunResult) GetHasPriorBackup() bool {if x != nil {- return x.ExportArchiveUid+ return x.HasPriorBackup}- return 0+ return false}-func (x *TaskRunResult) GetHasPriorBackup() bool {+func (x *TaskRunResult) GetExportArchiveId() string {if x != nil {- return x.HasPriorBackup+ return x.ExportArchiveId}- return false+ return ""}// SchedulerInfo contains information about task scheduling and execution delays.@@ -397,11 +397,11 @@ const file_store_task_run_proto_rawDesc = "" +"\bCANCELED\x10\x05\x12\x0f\n" +"\vNOT_STARTED\x10\x06\x12\v\n" +"\aSKIPPED\x10\a\x12\r\n" +- "\tAVAILABLE\x10\b\"\x7f\n" ++ "\tAVAILABLE\x10\b\"\x83\x01\n" +"\rTaskRunResult\x12\x16\n" +- "\x06detail\x18\x01 \x01(\tR\x06detail\x12,\n" +- "\x12export_archive_uid\x18\x05 \x01(\x05R\x10exportArchiveUid\x12(\n" +- "\x10has_prior_backup\x18\x06 \x01(\bR\x0ehasPriorBackup\"\xea\x01\n" ++ "\x06detail\x18\x01 \x01(\tR\x06detail\x12(\n" ++ "\x10has_prior_backup\x18\x06 \x01(\bR\x0ehasPriorBackup\x12*\n" ++ "\x11export_archive_id\x18\t \x01(\tR\x0fexportArchiveIdJ\x04\b\x05\x10\x06\"\xea\x01\n" +"\rSchedulerInfo\x12;\n" +"\vreport_time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\n" +"reportTime\x12O\n" +diff --git a/backend/generated-go/store/task_run_equal.pb.go b/backend/generated-go/store/task_run_equal.pb.goindex fda70a8555..03c4f6326c 100644--- a/backend/generated-go/store/task_run_equal.pb.go+++ b/backend/generated-go/store/task_run_equal.pb.go@@ -23,10 +23,10 @@ func (x *TaskRunResult) Equal(y *TaskRunResult) bool {if x.Detail != y.Detail {return false}- if x.ExportArchiveUid != y.ExportArchiveUid {+ if x.HasPriorBackup != y.HasPriorBackup {return false}- if x.HasPriorBackup != y.HasPriorBackup {+ if x.ExportArchiveId != y.ExportArchiveId {return false}return truediff --git a/backend/generated-go/v1/sql_service.pb.go b/backend/generated-go/v1/sql_service.pb.goindex c92fc7e453..ced29ea4c4 100644--- a/backend/generated-go/v1/sql_service.pb.go+++ b/backend/generated-go/v1/sql_service.pb.go@@ -1869,7 +1869,7 @@ func (x *SearchQueryHistoriesResponse) GetNextPageToken() string {type QueryHistory struct {state protoimpl.MessageState `protogen:"open.v1"`// The name for the query history.- // Format: queryHistories/{uid}+ // Format: projects/{project}/queryHistories/{id}Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`// The database name to execute the query.// Format: instances/{instance}/databases/{databaseName}diff --git a/backend/migrator/migration/3.17/0008##cross_workspace_uuid_pk.sql b/backend/migrator/migration/3.17/0008##cross_workspace_uuid_pk.sqlnew file mode 100644index 0000000000..83dbe64d7c--- /dev/null+++ b/backend/migrator/migration/3.17/0008##cross_workspace_uuid_pk.sql@@ -0,0 +1,43 @@+-- Add resource_id columns+ALTER TABLE audit_log ADD COLUMN IF NOT EXISTS resource_id text;+UPDATE audit_log SET resource_id = gen_random_uuid()::text WHERE resource_id IS NULL;+ALTER TABLE audit_log ALTER COLUMN resource_id SET NOT NULL;+ALTER TABLE audit_log ALTER COLUMN resource_id SET DEFAULT gen_random_uuid()::text;+ALTER TABLE audit_log DROP CONSTRAINT IF EXISTS audit_log_pkey;+ALTER TABLE audit_log ADD PRIMARY KEY (resource_id);++ALTER TABLE query_history ADD COLUMN IF NOT EXISTS resource_id text;+UPDATE query_history SET resource_id = gen_random_uuid()::text WHERE resource_id IS NULL;+ALTER TABLE query_history ALTER COLUMN resource_id SET NOT NULL;+ALTER TABLE query_history ALTER COLUMN resource_id SET DEFAULT gen_random_uuid()::text;+ALTER TABLE query_history DROP CONSTRAINT IF EXISTS query_history_pkey;+ALTER TABLE query_history ADD PRIMARY KEY (resource_id);++ALTER TABLE export_archive ADD COLUMN IF NOT EXISTS resource_id text;+UPDATE export_archive SET resource_id = gen_random_uuid()::text WHERE resource_id IS NULL;+ALTER TABLE export_archive ALTER COLUMN resource_id SET NOT NULL;+ALTER TABLE export_archive ALTER COLUMN resource_id SET DEFAULT gen_random_uuid()::text;+ALTER TABLE export_archive DROP CONSTRAINT IF EXISTS export_archive_pkey;+ALTER TABLE export_archive ADD PRIMARY KEY (resource_id);++-- Backfill task_run.result JSONB: exportArchiveUid (int) → exportArchiveId (string uuid)+-- Only runs if export_archive.id column still exists (skipped on re-run after column drop)+DO $$ BEGIN+ IF EXISTS (+ SELECT 1 FROM information_schema.columns+ WHERE table_name = 'export_archive' AND column_name = 'id'+ ) THEN+ EXECUTE '+ UPDATE task_run+ SET result = (result - ''exportArchiveUid'') || jsonb_build_object(''exportArchiveId'', ea.resource_id)+ FROM export_archive ea+ WHERE (result->>''exportArchiveUid'')::int = ea.id+ AND result ? ''exportArchiveUid''+ ';+ END IF;+END $$;++-- Drop the legacy id columns (no longer referenced)+ALTER TABLE audit_log DROP COLUMN IF EXISTS id;+ALTER TABLE query_history DROP COLUMN IF EXISTS id;+ALTER TABLE export_archive DROP COLUMN IF EXISTS id;diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sqlindex 2a353013c8..087698cb9f 100644--- a/backend/migrator/migration/LATEST.sql+++ b/backend/migrator/migration/LATEST.sql@@ -328,7 +328,7 @@ CREATE UNIQUE INDEX idx_instance_change_history_unique_version ON instance_changALTER SEQUENCE instance_change_history_id_seq RESTART WITH 101;CREATE TABLE audit_log (- id bigserial PRIMARY KEY,+ resource_id text PRIMARY KEY DEFAULT gen_random_uuid()::text,created_at timestamptz NOT NULL DEFAULT now(),-- Stored as AuditLog (proto/store/store/audit_log.proto)payload jsonb NOT NULL DEFAULT '{}'@@ -344,8 +344,6 @@ CREATE INDEX idx_audit_log_payload_resource ON audit_log((payload->>'resource'))CREATE INDEX idx_audit_log_payload_user ON audit_log((payload->>'user'));-ALTER SEQUENCE audit_log_id_seq RESTART WITH 101;-CREATE TABLE issue_comment (resource_id text NOT NULL DEFAULT gen_random_uuid()::text,creator text NOT NULL,@@ -363,7 +361,7 @@ CREATE INDEX idx_issue_comment_issue_id ON issue_comment(project, issue_id);CREATE UNIQUE INDEX idx_issue_comment_unique_resource_id ON issue_comment(resource_id);CREATE TABLE query_history (- id bigserial PRIMARY KEY,+ resource_id text PRIMARY KEY DEFAULT gen_random_uuid()::text,creator text NOT NULL,created_at timestamptz NOT NULL DEFAULT now(),project text NOT NULL REFERENCES project(resource_id),@@ -378,8 +376,6 @@ CREATE TABLE query_history (CREATE INDEX idx_query_history_creator_created_at_project ON query_history(creator, created_at, project DESC);-ALTER SEQUENCE query_history_id_seq RESTART WITH 101;--- worksheet table stores worksheets in SQL Editor.CREATE TABLE worksheet (id serial,@@ -428,7 +424,7 @@ CREATE TABLE db_group ();CREATE TABLE export_archive (- id serial PRIMARY KEY,+ resource_id text PRIMARY KEY DEFAULT gen_random_uuid()::text,created_at timestamptz NOT NULL DEFAULT now(),bytes bytea,-- Stored as ExportArchivePayload (proto/store/store/export_archive.proto)diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.goindex fe778020df..68c5f7c966 100644--- a/backend/migrator/migrator_test.go+++ b/backend/migrator/migrator_test.go@@ -15,8 +15,8 @@ import (func TestLatestVersion(t *testing.T) {files, err := getSortedVersionedFiles()require.NoError(t, err)- require.Equal(t, semver.MustParse("3.17.7"), *files[len(files)-1].version)- require.Equal(t, "migration/3.17/0007##fix_project_fk_references.sql", files[len(files)-1].path)+ require.Equal(t, semver.MustParse("3.17.8"), *files[len(files)-1].version)+ require.Equal(t, "migration/3.17/0008##cross_workspace_uuid_pk.sql", files[len(files)-1].path)}func TestVersionUnique(t *testing.T) {diff --git a/backend/runner/taskrun/data_export_executor.go b/backend/runner/taskrun/data_export_executor.goindex 18c0a9988b..2c7dd853e8 100644--- a/backend/runner/taskrun/data_export_executor.go+++ b/backend/runner/taskrun/data_export_executor.go@@ -126,7 +126,7 @@ func (exec *DataExportExecutor) RunOnce(ctx context.Context, _ context.Context,}return &storepb.TaskRunResult{- ExportArchiveUid: int32(exportArchive.UID),+ ExportArchiveId: exportArchive.ResourceID,}, nil}diff --git a/backend/store/audit_log.go b/backend/store/audit_log.goindex ffcf02d5fb..46316855c6 100644--- a/backend/store/audit_log.go+++ b/backend/store/audit_log.go@@ -18,9 +18,9 @@ import ()type AuditLog struct {- ID int- CreatedAt time.Time- Payload *storepb.AuditLog+ ResourceID string+ CreatedAt time.Time+ Payload *storepb.AuditLog}type AuditLogFind struct {@@ -52,7 +52,7 @@ func (s *Store) CreateAuditLog(ctx context.Context, payload *storepb.AuditLog) efunc (s *Store) SearchAuditLogs(ctx context.Context, find *AuditLogFind) ([]*AuditLog, error) {q := qb.Q().Space(`SELECT- id,+ resource_id,created_at,payloadFROM audit_log@@ -73,7 +73,7 @@ func (s *Store) SearchAuditLogs(ctx context.Context, find *AuditLogFind) ([]*Aud}q.Space(fmt.Sprintf("ORDER BY %s", strings.Join(orderBy, ", ")))} else {- q.Space("ORDER BY id DESC")+ q.Space("ORDER BY created_at DESC")}if v := find.Limit; v != nil {q.Space("LIMIT ?", *v)@@ -101,7 +101,7 @@ func (s *Store) SearchAuditLogs(ctx context.Context, find *AuditLogFind) ([]*Audvar payload []byteif err := rows.Scan(- &l.ID,+ &l.ResourceID,&l.CreatedAt,&payload,); err != nil {diff --git a/backend/store/export_archive.go b/backend/store/export_archive.goindex 414c513575..b5b1240465 100644--- a/backend/store/export_archive.go+++ b/backend/store/export_archive.go@@ -13,84 +13,50 @@ import ()type ExportArchiveMessage struct {- UID int- CreatedAt time.Time- Bytes []byte- Payload *storepb.ExportArchivePayload-}--// FindExportArchiveMessage is the API message for finding export archives.-type FindExportArchiveMessage struct {- UID *int+ ResourceID string+ CreatedAt time.Time+ Bytes []byte+ Payload *storepb.ExportArchivePayload}// GetExportArchive gets a export archive.-func (s *Store) GetExportArchive(ctx context.Context, find *FindExportArchiveMessage) (*ExportArchiveMessage, error) {- exportArchives, err := s.ListExportArchives(ctx, find)- if err != nil {- return nil, err- }- if len(exportArchives) == 0 {- return nil, nil- }- if len(exportArchives) > 1 {- return nil, errors.Errorf("expected 1 export archive, got %d", len(exportArchives))- }- return exportArchives[0], nil-}--// ListExportArchives lists export archives.-func (s *Store) ListExportArchives(ctx context.Context, find *FindExportArchiveMessage) ([]*ExportArchiveMessage, error) {+func (s *Store) GetExportArchive(ctx context.Context, resourceID string) (*ExportArchiveMessage, error) {q := qb.Q().Space(`SELECT- id,+ resource_id,created_at,bytes,payloadFROM export_archive- WHERE TRUE- `)-- if v := find.UID; v != nil {- q.And("id = ?", *v)- }+ WHERE resource_id = ?+ `, resourceID)query, args, err := q.ToSQL()if err != nil {return nil, errors.Wrapf(err, "failed to build sql")}- rows, err := s.GetDB().QueryContext(ctx, query, args...)- if err != nil {- return nil, err- }- defer rows.Close()-- var exportArchives []*ExportArchiveMessage- for rows.Next() {- var exportArchive ExportArchiveMessage- var bytes, payload []byte- if err := rows.Scan(- &exportArchive.UID,- &exportArchive.CreatedAt,- &bytes,- &payload,- ); err != nil {- return nil, err- }- exportArchivePayload := &storepb.ExportArchivePayload{}- if err := common.ProtojsonUnmarshaler.Unmarshal(payload, exportArchivePayload); err != nil {- return nil, err+ var exportArchive ExportArchiveMessage+ var bytesVal, payload []byte+ if err := s.GetDB().QueryRowContext(ctx, query, args...).Scan(+ &exportArchive.ResourceID,+ &exportArchive.CreatedAt,+ &bytesVal,+ &payload,+ ); err != nil {+ if err.Error() == "sql: no rows in result set" {+ return nil, nil}- exportArchive.Payload = exportArchivePayload- exportArchive.Bytes = bytes- exportArchives = append(exportArchives, &exportArchive)+ return nil, err}- if err := rows.Err(); err != nil {+ exportArchivePayload := &storepb.ExportArchivePayload{}+ if err := common.ProtojsonUnmarshaler.Unmarshal(payload, exportArchivePayload); err != nil {return nil, err}+ exportArchive.Payload = exportArchivePayload+ exportArchive.Bytes = bytesVal- return exportArchives, nil+ return &exportArchive, nil}// CreateExportArchive creates a export archive.@@ -106,7 +72,7 @@ func (s *Store) CreateExportArchive(ctx context.Context, create *ExportArchiveMepayload)VALUES (?, ?)- RETURNING id+ RETURNING resource_id`, create.Bytes, payload)query, args, err := q.ToSQL()@@ -114,28 +80,13 @@ func (s *Store) CreateExportArchive(ctx context.Context, create *ExportArchiveMereturn nil, errors.Wrapf(err, "failed to build sql")}- if err := s.GetDB().QueryRowContext(ctx, query, args...).Scan(&create.UID); err != nil {+ if err := s.GetDB().QueryRowContext(ctx, query, args...).Scan(&create.ResourceID); err != nil {return nil, err}return create, nil}-// DeleteExportArchive deletes a export archive.-func (s *Store) DeleteExportArchive(ctx context.Context, uid int) error {- q := qb.Q().Space("DELETE FROM export_archive WHERE id = ?", uid)- query, args, err := q.ToSQL()- if err != nil {- return errors.Wrapf(err, "failed to build sql")- }-- if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil {- return err- }-- return nil-}-// DeleteExpiredExportArchives deletes export archives older than the specified retention period.// Returns the number of archives deleted.func (s *Store) DeleteExpiredExportArchives(ctx context.Context, retentionPeriod time.Duration) (int64, error) {diff --git a/backend/store/query_history.go b/backend/store/query_history.goindex cdb1b053c7..a84e56e844 100644--- a/backend/store/query_history.go+++ b/backend/store/query_history.go@@ -28,8 +28,8 @@ const (// QueryHistoryMessage is the API message for query history.type QueryHistoryMessage struct {// Output only fields- UID int- CreatedAt time.Time+ ResourceID string+ CreatedAt time.Time// Related fieldsCreator string@@ -77,7 +77,7 @@ func (s *Store) CreateQueryHistory(ctx context.Context, create *QueryHistoryMess)VALUES (?, ?, ?, ?, ?, ?)RETURNING- id,+ resource_id,created_at`,create.Creator,@@ -94,7 +94,7 @@ func (s *Store) CreateQueryHistory(ctx context.Context, create *QueryHistoryMess}if err := s.GetDB().QueryRowContext(ctx, sql, args...).Scan(- &create.UID,+ &create.ResourceID,&create.CreatedAt,); err != nil {return nil, err@@ -107,7 +107,7 @@ func (s *Store) CreateQueryHistory(ctx context.Context, create *QueryHistoryMessfunc (s *Store) ListQueryHistories(ctx context.Context, find *FindQueryHistoryMessage) ([]*QueryHistoryMessage, error) {q := qb.Q().Space(`SELECT- query_history.id,+ query_history.resource_id,query_history.creator,query_history.created_at,query_history.project,@@ -137,7 +137,7 @@ func (s *Store) ListQueryHistories(ctx context.Context, find *FindQueryHistoryMeq.And("query_history.type = ?", *v)}- q.Space("ORDER BY id DESC")+ q.Space("ORDER BY created_at DESC")if v := find.Limit; v != nil {q.Space("LIMIT ?", *v)}@@ -161,7 +161,7 @@ func (s *Store) ListQueryHistories(ctx context.Context, find *FindQueryHistoryMequeryHistory := &QueryHistoryMessage{}var payloadStr stringif err := rows.Scan(- &queryHistory.UID,+ &queryHistory.ResourceID,&queryHistory.Creator,&queryHistory.CreatedAt,&queryHistory.Project,diff --git a/frontend/src/types/proto-es/v1/sql_service_pb.d.ts b/frontend/src/types/proto-es/v1/sql_service_pb.d.tsindex 2fe09f0c03..8feda33937 100644--- a/frontend/src/types/proto-es/v1/sql_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/sql_service_pb.d.ts@@ -1214,7 +1214,7 @@ export declare const SearchQueryHistoriesResponseSchema: GenMessage<SearchQueryHexport declare type QueryHistory = Message<"bytebase.v1.QueryHistory"> & {/*** The name for the query history.- * Format: queryHistories/{uid}+ * Format: projects/{project}/queryHistories/{id}** @generated from field: string name = 1;*/diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex eab7227e08..66c1219dac 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -23885,7 +23885,7 @@ components:title: namedescription: |-The name for the query history.- Format: queryHistories/{uid}+ Format: projects/{project}/queryHistories/{id}readOnly: truedatabase:type: stringdiff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex cf7c1ee169..3f66c0af7d 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -4788,8 +4788,8 @@ TaskRunResult contains the outcome and metadata from a task run execution.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- || detail | [string](#string) | | Error message for failed task runs. Empty for successful or canceled runs. |-| export_archive_uid | [int32](#int32) | | UID of the export archive generated for export tasks. || has_prior_backup | [bool](#bool) | | Indicates whether a prior backup was created for this task run. When true, the task run can be rolled back using the backup tables. Backup details are available in the task run logs (PRIOR_BACKUP log entries). |+| export_archive_id | [string](#string) | | Resource ID of the export archive generated for export tasks. |diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 231176f15b..213f788864 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -13024,13 +13024,6 @@ or sheet content for non-release tasks.</p></td><td><p>Error message for failed task runs. Empty for successful or canceled runs. </p></td></tr>- <tr>- <td>export_archive_uid</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p>UID of the export archive generated for export tasks. </p></td>- </tr>-<tr><td>has_prior_backup</td><td><a href="#bool">bool</a></td>@@ -13040,6 +13033,13 @@ When true, the task run can be rolled back using the backup tables.Backup details are available in the task run logs (PRIOR_BACKUP log entries). </p></td></tr>+ <tr>+ <td>export_archive_id</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>Resource ID of the export archive generated for export tasks. </p></td>+ </tr>+</tbody></table>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 1b860b1810..a2e3c84af3 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -7177,7 +7177,7 @@ OrgPolicyService manages organizational policies at various resource levels.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| name | [string](#string) | | The name for the query history. Format: queryHistories/{uid} |+| name | [string](#string) | | The name for the query history. Format: projects/{project}/queryHistories/{id} || database | [string](#string) | | The database name to execute the query. Format: instances/{instance}/databases/{databaseName} || creator | [string](#string) | | || create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex ecdb86af4d..3a70cad59b 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -20423,7 +20423,7 @@ Oracle and search path in Postgres. </p></td><td><a href="#string">string</a></td><td></td><td><p>The name for the query history.-Format: queryHistories/{uid} </p></td>+Format: projects/{project}/queryHistories/{id} </p></td></tr><tr>diff --git a/proto/store/store/task_run.proto b/proto/store/store/task_run.protoindex f24d215352..b0cafde09b 100644--- a/proto/store/store/task_run.proto+++ b/proto/store/store/task_run.proto@@ -35,13 +35,15 @@ message TaskRunResult {// Error message for failed task runs. Empty for successful or canceled runs.string detail = 1;- // UID of the export archive generated for export tasks.- int32 export_archive_uid = 5;+ reserved 5;// Indicates whether a prior backup was created for this task run.// When true, the task run can be rolled back using the backup tables.// Backup details are available in the task run logs (PRIOR_BACKUP log entries).bool has_prior_backup = 6;++ // Resource ID of the export archive generated for export tasks.+ string export_archive_id = 9;}// SchedulerInfo contains information about task scheduling and execution delays.diff --git a/proto/v1/v1/sql_service.proto b/proto/v1/v1/sql_service.protoindex a826531d64..b2079346c5 100644--- a/proto/v1/v1/sql_service.proto+++ b/proto/v1/v1/sql_service.proto@@ -501,7 +501,7 @@ message SearchQueryHistoriesResponse {message QueryHistory {// The name for the query history.- // Format: queryHistories/{uid}+ // Format: projects/{project}/queryHistories/{id}string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];// The database name to execute the query.