Skip to content

Commit

Permalink
system_tables: fix st_indexes_schema inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Nov 16, 2023
1 parent 5a23fad commit 1bb848d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions crates/core/src/db/datastore/locking_tx_datastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2701,9 +2701,9 @@ mod tests {
ColRow { table: 3, pos: 0, name: "index_id", ty: AlgebraicType::U32, autoinc: true },
ColRow { table: 3, pos: 1, name: "table_id", ty: AlgebraicType::U32, autoinc: false },
ColRow { table: 3, pos: 2, name: "index_name", ty: AlgebraicType::String, autoinc: false },
ColRow { table: 3, pos: 3, name: "columns", ty: AlgebraicType::array(AlgebraicType::U32), autoinc: false },
ColRow { table: 3, pos: 4, name: "is_unique", ty: AlgebraicType::Bool, autoinc: false },
ColRow { table: 3, pos: 5, name: "index_type", ty: AlgebraicType::U8, autoinc: false },
ColRow { table: 3, pos: 3, name: "index_type", ty: AlgebraicType::U8, autoinc: false },
ColRow { table: 3, pos: 4, name: "columns", ty: AlgebraicType::array(AlgebraicType::U32), autoinc: false },
ColRow { table: 3, pos: 5, name: "is_unique", ty: AlgebraicType::Bool, autoinc: false },

ColRow { table: 4, pos: 0, name: "constraint_id", ty: AlgebraicType::U32, autoinc: true },
ColRow { table: 4, pos: 1, name: "constraint_name", ty: AlgebraicType::String, autoinc: false },
Expand Down
14 changes: 7 additions & 7 deletions crates/core/src/db/datastore/system_tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,13 @@ pub fn st_indexes_schema() -> TableSchema {
col_type: AlgebraicType::String,
is_autoinc: false,
},
ColumnSchema {
table_id: ST_INDEXES_ID,
col_id: StIndexFields::IndexType.col_id(),
col_name: StIndexFields::IndexType.col_name(),
col_type: AlgebraicType::U8,
is_autoinc: false,
},
ColumnSchema {
table_id: ST_INDEXES_ID,
col_id: StIndexFields::Columns.col_id(),
Expand All @@ -353,13 +360,6 @@ pub fn st_indexes_schema() -> TableSchema {
col_type: AlgebraicType::Bool,
is_autoinc: false,
},
ColumnSchema {
table_id: ST_INDEXES_ID,
col_id: StIndexFields::IndexType.col_id(),
col_name: StIndexFields::IndexType.col_name(),
col_type: AlgebraicType::U8,
is_autoinc: false,
},
],
// TODO: Unique constraint on index name?
constraints: vec![],
Expand Down

0 comments on commit 1bb848d

Please sign in to comment.