Skip to content

Fix index schema from st tables.#5145

Open
Shubham8287 wants to merge 7 commits into
masterfrom
shub/fix-table-migration-index
Open

Fix index schema from st tables.#5145
Shubham8287 wants to merge 7 commits into
masterfrom
shub/fix-table-migration-index

Conversation

@Shubham8287
Copy link
Copy Markdown
Contributor

@Shubham8287 Shubham8287 commented May 29, 2026

Description of Changes

fixes #4701.

IndexSchema when build from system tables, wasn't considering st_index_accessor table to set alias.

API and ABI breaking changes

NA

Expected complexity level and risk

2.5

Testing

Added a smoketest for typescript, this is more apparent in typescript due to snake_case name casing results in different canonical and accessor name.

@Shubham8287 Shubham8287 changed the title Fix index. accessor entries on table migration Fix indexes alias on table migration May 29, 2026
@Shubham8287 Shubham8287 force-pushed the shub/fix-table-migration-index branch from 6191d7c to 7e41705 Compare May 29, 2026 13:51
@Shubham8287 Shubham8287 changed the title Fix indexes alias on table migration Fix indexe schema on restart. May 29, 2026
@Shubham8287 Shubham8287 changed the title Fix indexe schema on restart. Fix index schema from st tables. May 29, 2026
@Shubham8287 Shubham8287 self-assigned this May 29, 2026
Comment thread crates/datastore/src/locking_tx_datastore/state_view.rs
Comment thread crates/smoketests/tests/smoketests/typescript_index_source_name.rs
@Shubham8287 Shubham8287 force-pushed the shub/fix-table-migration-index branch from e8fb6cc to e2a1966 Compare June 2, 2026 12:39
@Shubham8287 Shubham8287 marked this pull request as draft June 2, 2026 12:49
@Shubham8287 Shubham8287 marked this pull request as ready for review June 3, 2026 16:06
);

const spacetimedb = schema({
renamedUsers,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This renames the table accessor too. We're migrating st_index_accessor, but what about st_table_accessor?

Copy link
Copy Markdown
Contributor Author

@Shubham8287 Shubham8287 Jun 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I should fix accessor name changes in separate PR, as that change requires more thorough considerations.

I am keeping the current PR to fix building correct IndexSchema from sys tables, Which will unblock the table migration path. As people will run into table migration more frequently than changing accessor name especially during Hackothon

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable to me.

@rekhoff rekhoff enabled auto-merge June 3, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS runtime 2.0.4 derives internal index names from accessor keys instead of canonical schema names, causing "No such index" panics after publish

3 participants