diff --git a/pkg/schema/table/table.go b/pkg/schema/table/table.go index 1e5bf6351..525407a25 100644 --- a/pkg/schema/table/table.go +++ b/pkg/schema/table/table.go @@ -188,14 +188,10 @@ var ( Columns: []string{ "cluster_id", "id", - "keyspace_name", - "location", - "manifest_path", "prev_id", "repair_task_id", "snapshot_tag", "stage", - "table_name", "task_id", "units", "views", @@ -222,6 +218,7 @@ var ( "host", "keyspace_name", "manifest_path", + "remote_sstable_dir", "restore_completed_at", "restore_started_at", "run_id", diff --git a/pkg/service/restore/model.go b/pkg/service/restore/model.go index a19e99101..b2b79cc3f 100644 --- a/pkg/service/restore/model.go +++ b/pkg/service/restore/model.go @@ -90,12 +90,6 @@ type Run struct { // Cache that's initialized once for entire task Units []Unit Views []View - - // Remove those fields to schema. - Location string - ManifestPath string - Keyspace string `db:"keyspace_name"` - Table string `db:"table_name"` } // Unit represents restored keyspace and its tables with their size. @@ -166,7 +160,7 @@ type RunProgress struct { TaskID uuid.UUID RunID uuid.UUID - RemoteSSTableDir string // Add this field to schema. + RemoteSSTableDir string `db:"remote_sstable_dir"` Keyspace string `db:"keyspace_name"` Table string `db:"table_name"` SSTableID []string `db:"sstable_id"` @@ -185,7 +179,7 @@ type RunProgress struct { Failed int64 VersionedProgress int64 - // Remove this field from schema. + // Not used, but can't be removed because it is clustering key. ManifestPath string } diff --git a/schema/v3.4.0.cql b/schema/v3.4.0.cql new file mode 100644 index 000000000..baa569ffa --- /dev/null +++ b/schema/v3.4.0.cql @@ -0,0 +1,6 @@ +ALTER TABLE restore_run DROP location; +ALTER TABLE restore_run DROP manifest_path; +ALTER TABLE restore_run DROP keyspace_name; +ALTER TABLE restore_run DROP table_name; + +ALTER TABLE restore_run_progress ADD remote_sstable_dir text;