Skip to content

Commit 924e5a3

Browse files
nipunn1313Convex, Inc.
authored andcommitted
Run migration for exports by requestor column (#29515)
Filter out non snapshotExport sources by default once we run the migration GitOrigin-RevId: 4ec2243fad60bdace69d8da68f35e6d6e5e1b498
1 parent dc16b9d commit 924e5a3

File tree

1 file changed

+18
-6
lines changed
  • crates/model/src/exports

1 file changed

+18
-6
lines changed

crates/model/src/exports/mod.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,37 @@ pub static EXPORTS_TABLE: LazyLock<TableName> =
4040
pub static EXPORTS_BY_STATE_AND_TS_INDEX: LazyLock<IndexName> =
4141
LazyLock::new(|| system_index(&EXPORTS_TABLE, "by_state_and_ts"));
4242

43+
pub static EXPORTS_BY_REQUESTOR: LazyLock<IndexName> =
44+
LazyLock::new(|| system_index(&EXPORTS_TABLE, "by_requestor"));
45+
4346
pub static EXPORTS_STATE_FIELD: LazyLock<FieldPath> =
4447
LazyLock::new(|| "state".parse().expect("Invalid built-in field"));
4548

4649
pub static EXPORTS_TS_FIELD: LazyLock<FieldPath> =
4750
LazyLock::new(|| "start_ts".parse().expect("Invalid built-in field"));
4851

52+
static EXPORTS_REQUESTOR_FIELD: LazyLock<FieldPath> =
53+
LazyLock::new(|| "requestor".parse().expect("Invalid built-in field"));
54+
4955
pub struct ExportsTable;
5056
impl SystemTable for ExportsTable {
5157
fn table_name(&self) -> &'static TableName {
5258
&EXPORTS_TABLE
5359
}
5460

5561
fn indexes(&self) -> Vec<SystemIndex> {
56-
vec![SystemIndex {
57-
name: EXPORTS_BY_STATE_AND_TS_INDEX.clone(),
58-
fields: vec![EXPORTS_STATE_FIELD.clone(), EXPORTS_TS_FIELD.clone()]
59-
.try_into()
60-
.unwrap(),
61-
}]
62+
vec![
63+
SystemIndex {
64+
name: EXPORTS_BY_STATE_AND_TS_INDEX.clone(),
65+
fields: vec![EXPORTS_STATE_FIELD.clone(), EXPORTS_TS_FIELD.clone()]
66+
.try_into()
67+
.unwrap(),
68+
},
69+
SystemIndex {
70+
name: EXPORTS_BY_REQUESTOR.clone(),
71+
fields: vec![EXPORTS_REQUESTOR_FIELD.clone()].try_into().unwrap(),
72+
},
73+
]
6274
}
6375

6476
fn validate_document(&self, document: ResolvedDocument) -> anyhow::Result<()> {

0 commit comments

Comments
 (0)