Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bins/torii-introspect-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ async fn run_with_postgres(
decoder.store.initialize().await?;
sink.initialize_introspect_pg_sink().await?;
decoder.load_tables(&[]).await?;
sink.load_tables_no_commit(decoder.get_tables()?)?;

let decoder: Arc<dyn torii::etl::Decoder> = Arc::new(decoder);

Expand Down
22 changes: 9 additions & 13 deletions crates/dojo/migrations/001_dojo_store.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,36 @@ BEGIN
CREATE DOMAIN uint64 AS NUMERIC(20, 0)
CHECK (VALUE >= 0 AND VALUE < power(2::numeric, 64));
END IF;

IF to_regtype('introspect.attribute') IS NULL THEN
CREATE TYPE introspect.attribute AS (
name TEXT,
data bytea
);
END IF;
END $$;

CREATE TABLE IF NOT EXISTS dojo.tables (
owner felt252,
id felt252 NOT NULL,
block_number uint64 NOT NULL,
name TEXT NOT NULL,
attributes TEXT[] NOT NULL DEFAULT '{}',
keys felt252[] NOT NULL,
"values" felt252[] NOT NULL ,
legacy BOOLEAN NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
created_block uint64 NOT NULL,
updated_block uint64 NOT NULL,
created_tx felt252 NOT NULL,
updated_tx felt252 NOT NULL,
PRIMARY KEY (owner, id)
PRIMARY KEY (owner, id, block_number)
);

CREATE TABLE IF NOT EXISTS dojo.columns(
owner felt252,
"table" felt252 NOT NULL ,
id felt252 NOT NULL,
block_number uint64 NOT NULL,
name TEXT NOT NULL,
attributes introspect.attribute[] NOT NULL DEFAULT '{}',
attributes TEXT[] NOT NULL DEFAULT '{}',
type_def jsonb NOT NULL,
PRIMARY KEY (owner, "table", id),
FOREIGN KEY (owner, "table") REFERENCES dojo.tables(owner, id)
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
created_tx felt252 NOT NULL,
updated_tx felt252 NOT NULL,
PRIMARY KEY (owner, "table", id, block_number)
);

Loading
Loading