-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(torii): remove executor from world table & write class hash (#…
…2166) * refactor(torii): remove executor from world table & write class hash * refactor: world class hash column NOT NULL * fmt * refactor: use correct world class hash * chore: remove clippy * fix: fmt * fmt * refactor: latets to pending tag * fix: fix typo and clippy --------- Co-authored-by: glihm <[email protected]>
- Loading branch information
Showing
11 changed files
with
77 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
crates/torii/migrations/20240709134347_remove_world_executor.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- NOTE: sqlite does not support deleteing columns. Workaround is to create new table, copy, and delete old. | ||
|
||
-- Create new table without executor_address and executor_class_hash columns | ||
CREATE TABLE worlds_new ( | ||
id TEXT PRIMARY KEY NOT NULL, | ||
world_address TEXT NOT NULL, | ||
world_class_hash TEXT NOT NULL, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
-- Copy from old worlds | ||
INSERT INTO worlds_new (id, world_address, world_class_hash, created_at) | ||
SELECT id, world_address, world_class_hash, created_at | ||
FROM worlds; | ||
|
||
-- Disable foreign keys constraint so we can delete worlds | ||
PRAGMA foreign_keys = OFF; | ||
|
||
-- Drop old worlds | ||
DROP TABLE worlds; | ||
|
||
-- Rename table and recreate indexes | ||
ALTER TABLE worlds_new RENAME TO worlds; | ||
|
||
-- Renable foreign keys | ||
PRAGMA foreign_keys = ON; |