refactor: remove retention_duration field from namespace catalog table (#6124)

pull/24376/head
Nga Tran 2022-11-11 15:30:42 -05:00 committed by GitHub
parent 1b322a6a6e
commit a3f2fe489c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 8 deletions

View File

@ -438,10 +438,7 @@ pub struct Namespace {
pub id: NamespaceId,
/// The unique name of the namespace
pub name: String,
/// The retention duration as a string. 'inf' or not present represents infinite duration (i.e.
/// never drop data).
#[sqlx(default)]
pub retention_duration: Option<String>,
/// The retention period in ns. None represents infinite duration (i.e. never drop data).
pub retention_period_ns: Option<i64>,
/// The topic that writes to this namespace will land in

View File

@ -0,0 +1 @@
ALTER TABLE namespace DROP COLUMN IF EXISTS retention_duration;

View File

@ -301,7 +301,6 @@ impl NamespaceRepo for MemTxn {
name: name.to_string(),
topic_id,
query_pool_id,
retention_duration: Some("inf".to_string()), // temporary until the field retention_durantion is removed in the catalgo table in next PR
max_tables: DEFAULT_MAX_TABLES,
max_columns_per_table: DEFAULT_MAX_COLUMNS_PER_TABLE,
retention_period_ns: DEFAULT_RETENTION_PERIOD,

View File

@ -30,7 +30,6 @@ pub struct NamespaceAutocreation<C, T> {
topic_id: TopicId,
query_id: QueryPoolId,
retention: String,
_input: PhantomData<T>,
}
@ -165,7 +164,6 @@ mod tests {
cache,
TopicId::new(42),
QueryPoolId::new(42),
"inf".to_owned(),
);
// Drive the code under test
@ -201,7 +199,6 @@ mod tests {
cache,
TopicId::new(42),
QueryPoolId::new(42),
"inf".to_owned(),
);
creator

View File

@ -200,7 +200,6 @@ mod tests {
Namespace {
id: NamespaceId::new(1),
name: ns.to_string(),
retention_duration: Some("inf".to_owned()),
topic_id: TopicId::new(42),
query_pool_id: QueryPoolId::new(42),
max_tables: iox_catalog::DEFAULT_MAX_TABLES,