From ce132425507dd16583bf5c20d5c426ed81aa6725 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 20 Apr 2026 08:12:24 -0400 Subject: [PATCH] MT#64939 recording: fields indicating storage For each possible storage location, adds a bool flag to indicate whether the media file is expected to be there. For S3 and GCS, additionally add a field to store the URI to access the media. Change-Id: I7ad44275b8ffcfc0202968fcf9ad4cd883b07228 --- db_scripts/diff/15884.down | 9 +++++ db_scripts/diff/15884.up | 9 +++++ schema/ngcp.sql | 3 +- schema/provisioning.json | 72 ++++++++++++++++++++++++++++++++++++++ schema/provisioning.sql | 6 ++++ 5 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 db_scripts/diff/15884.down create mode 100644 db_scripts/diff/15884.up diff --git a/db_scripts/diff/15884.down b/db_scripts/diff/15884.down new file mode 100644 index 00000000..59180a76 --- /dev/null +++ b/db_scripts/diff/15884.down @@ -0,0 +1,9 @@ +use provisioning; + +alter table recording_streams + drop column storage_file, + drop column storage_db, + drop column storage_s3, + drop column storage_gcs, + drop column s3_uri, + drop column gcs_uri; diff --git a/db_scripts/diff/15884.up b/db_scripts/diff/15884.up new file mode 100644 index 00000000..0abb9bbe --- /dev/null +++ b/db_scripts/diff/15884.up @@ -0,0 +1,9 @@ +use provisioning; + +alter table recording_streams + add column storage_file tinyint(1) not null default 1, + add column storage_db tinyint(1) not null default 0, + add column storage_s3 tinyint(1) not null default 0, + add column storage_gcs tinyint(1) not null default 0, + add column s3_uri varchar(255) not null default '', + add column gcs_uri varchar(255) not null default ''; diff --git a/schema/ngcp.sql b/schema/ngcp.sql index c7206116..41684d39 100644 --- a/schema/ngcp.sql +++ b/schema/ngcp.sql @@ -25,7 +25,7 @@ CREATE TABLE `db_schema` ( PRIMARY KEY (`id`), UNIQUE KEY `rev_idx` (`revision`,`node`,`site_id`), KEY `release_idx` (`release`) -) ENGINE=InnoDB AUTO_INCREMENT=927 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=928 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8mb4 */; @@ -30979,6 +30979,7 @@ INSERT INTO `db_schema` VALUES (923,15878,'spce','1970-01-01 00:00:01','trunk',1 INSERT INTO `db_schema` VALUES (924,15879,'spce','1970-01-01 00:00:01','trunk',1); INSERT INTO `db_schema` VALUES (925,15880,'spce','1970-01-01 00:00:01','trunk',1); INSERT INTO `db_schema` VALUES (926,15881,'spce','1970-01-01 00:00:01','trunk',1); +INSERT INTO `db_schema` VALUES (927,15884,'spce','1970-01-01 00:00:01','trunk',1); COMMIT; SET AUTOCOMMIT=@OLD_AUTOCOMMIT; SET @OLD_AUTOCOMMIT=@@AUTOCOMMIT, @@AUTOCOMMIT=0; diff --git a/schema/provisioning.json b/schema/provisioning.json index 4a4ef774..1f8bdc62 100644 --- a/schema/provisioning.json +++ b/schema/provisioning.json @@ -1320,6 +1320,18 @@ "TABLE_NAME" : "recording_streams", "key_col" : "recording_streams/full_filename" }, + "recording_streams/gcs_uri" : { + "CHARACTER_SET_NAME" : "utf8mb3", + "COLLATION_NAME" : "utf8mb3_general_ci", + "COLUMN_DEFAULT" : "''", + "COLUMN_NAME" : "gcs_uri", + "COLUMN_TYPE" : "varchar(255)", + "EXTRA" : "", + "IS_NULLABLE" : "NO", + "ORDINAL_POSITION" : 24, + "TABLE_NAME" : "recording_streams", + "key_col" : "recording_streams/gcs_uri" + }, "recording_streams/id" : { "CHARACTER_SET_NAME" : null, "COLLATION_NAME" : null, @@ -1356,6 +1368,18 @@ "TABLE_NAME" : "recording_streams", "key_col" : "recording_streams/output_type" }, + "recording_streams/s3_uri" : { + "CHARACTER_SET_NAME" : "utf8mb3", + "COLLATION_NAME" : "utf8mb3_general_ci", + "COLUMN_DEFAULT" : "''", + "COLUMN_NAME" : "s3_uri", + "COLUMN_TYPE" : "varchar(255)", + "EXTRA" : "", + "IS_NULLABLE" : "NO", + "ORDINAL_POSITION" : 23, + "TABLE_NAME" : "recording_streams", + "key_col" : "recording_streams/s3_uri" + }, "recording_streams/sample_rate" : { "CHARACTER_SET_NAME" : null, "COLLATION_NAME" : null, @@ -1404,6 +1428,54 @@ "TABLE_NAME" : "recording_streams", "key_col" : "recording_streams/start_timestamp" }, + "recording_streams/storage_db" : { + "CHARACTER_SET_NAME" : null, + "COLLATION_NAME" : null, + "COLUMN_DEFAULT" : "0", + "COLUMN_NAME" : "storage_db", + "COLUMN_TYPE" : "tinyint(1)", + "EXTRA" : "", + "IS_NULLABLE" : "NO", + "ORDINAL_POSITION" : 20, + "TABLE_NAME" : "recording_streams", + "key_col" : "recording_streams/storage_db" + }, + "recording_streams/storage_file" : { + "CHARACTER_SET_NAME" : null, + "COLLATION_NAME" : null, + "COLUMN_DEFAULT" : "1", + "COLUMN_NAME" : "storage_file", + "COLUMN_TYPE" : "tinyint(1)", + "EXTRA" : "", + "IS_NULLABLE" : "NO", + "ORDINAL_POSITION" : 19, + "TABLE_NAME" : "recording_streams", + "key_col" : "recording_streams/storage_file" + }, + "recording_streams/storage_gcs" : { + "CHARACTER_SET_NAME" : null, + "COLLATION_NAME" : null, + "COLUMN_DEFAULT" : "0", + "COLUMN_NAME" : "storage_gcs", + "COLUMN_TYPE" : "tinyint(1)", + "EXTRA" : "", + "IS_NULLABLE" : "NO", + "ORDINAL_POSITION" : 22, + "TABLE_NAME" : "recording_streams", + "key_col" : "recording_streams/storage_gcs" + }, + "recording_streams/storage_s3" : { + "CHARACTER_SET_NAME" : null, + "COLLATION_NAME" : null, + "COLUMN_DEFAULT" : "0", + "COLUMN_NAME" : "storage_s3", + "COLUMN_TYPE" : "tinyint(1)", + "EXTRA" : "", + "IS_NULLABLE" : "NO", + "ORDINAL_POSITION" : 21, + "TABLE_NAME" : "recording_streams", + "key_col" : "recording_streams/storage_s3" + }, "recording_streams/stream" : { "CHARACTER_SET_NAME" : null, "COLLATION_NAME" : null, diff --git a/schema/provisioning.sql b/schema/provisioning.sql index 147e7e88..eeddc214 100644 --- a/schema/provisioning.sql +++ b/schema/provisioning.sql @@ -286,6 +286,12 @@ CREATE TABLE `recording_streams` ( `stream` longblob NOT NULL DEFAULT '', `transcript_status` enum('none','pending','done') NOT NULL DEFAULT 'none', `transcript` text NOT NULL DEFAULT '', + `storage_file` tinyint(1) NOT NULL DEFAULT 1, + `storage_db` tinyint(1) NOT NULL DEFAULT 0, + `storage_s3` tinyint(1) NOT NULL DEFAULT 0, + `storage_gcs` tinyint(1) NOT NULL DEFAULT 0, + `s3_uri` varchar(255) NOT NULL DEFAULT '', + `gcs_uri` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `call` (`call`), KEY `transcript_status_call_idx` (`transcript_status`,`call`),