Skip to content

Commit

Permalink
[indexer]: Create script to autogenerate indexer schema (#5012)
Browse files Browse the repository at this point in the history
* [indexer]: Create script to autogenerate indexer schema

* Convert script to dockerized version

Co-authored-by: muXxer <[email protected]>

* Update script name in schema.patch

* Allow build to be called from anywhere

* Ensure the required image is built

* Rename indexer-generate-schema to indexer-schema

---------

Co-authored-by: muXxer <[email protected]>
Co-authored-by: Konstantinos Demartinos <[email protected]>
  • Loading branch information
3 people authored Jan 29, 2025
1 parent 794e8f4 commit 919a9e8
Show file tree
Hide file tree
Showing 7 changed files with 602 additions and 2,603 deletions.
32 changes: 30 additions & 2 deletions crates/iota-indexer/src/schema.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
diff --git a/crates/iota-indexer/src/schema.rs b/crates/iota-indexer/src/schema.rs
--- a/crates/iota-indexer/src/schema.rs
+++ b/crates/iota-indexer/src/schema.rs
@@ -1 +1,4 @@
@@ -1,4 +1,7 @@
-// @generated automatically by Diesel CLI.
+// Copyright (c) Mysten Labs, Inc.
+// Modifications Copyright (c) 2024 IOTA Stiftung
+// SPDX-License-Identifier: Apache-2.0
// @generated automatically by Diesel CLI.
+// @generated automatically by scripts/indexer-schema/generate.sh

diesel::table! {
active_addresses (address) {
@@ -414,7 +417,10 @@ diesel::table! {
}
}

-diesel::allow_tables_to_appear_in_same_query!(
+#[macro_export]
+macro_rules! for_all_tables {
+ ($action:path) => {
+ $action!(
active_addresses,
address_metrics,
addresses,
@@ -451,5 +457,9 @@ diesel::allow_tables_to_appear_in_same_query!(
tx_input_objects,
tx_kinds,
tx_recipients,
- tx_senders,
-);
+ tx_senders
+ );
+ };
+}
+pub use for_all_tables;
+for_all_tables!(diesel::allow_tables_to_appear_in_same_query);
Loading

0 comments on commit 919a9e8

Please sign in to comment.