-
Notifications
You must be signed in to change notification settings - Fork 48
Just clean up, no changes #609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,6 @@ let isPrimaryKey = true | |
| let isNullable = true | ||
| let isIndex = true | ||
|
|
||
| let publicSchema = Env.Db.publicSchema | ||
|
|
||
| module EventSyncState = { | ||
| //Used unsafely in DbFunctions.res so just enforcing the naming here | ||
| let blockTimestampFieldName = "block_timestamp" | ||
|
|
@@ -24,7 +22,6 @@ module EventSyncState = { | |
|
|
||
| let table = mkTable( | ||
| "event_sync_state", | ||
| ~schemaName=publicSchema, | ||
| ~fields=[ | ||
| mkField("chain_id", Integer, ~fieldSchema=S.int, ~isPrimaryKey), | ||
| mkField(blockNumberFieldName, Integer, ~fieldSchema=S.int), | ||
|
|
@@ -42,7 +39,7 @@ module EventSyncState = { | |
|
|
||
| //We need to update values here not delet the rows, since restarting without a row | ||
| //has a different behaviour to restarting with an initialised row with zero values | ||
| let resetCurrentCurrentSyncStateQuery = `UPDATE ${table.schemaName}.${table.tableName} | ||
| let resetCurrentCurrentSyncStateQuery = `UPDATE "${Env.Db.publicSchema}"."${table.tableName}" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why make this change? I don't mind either way, and I see this file used to access the env anyhow, but it seems counter productive for librifying if we remove thes from the state/config of the table. I personally think ultimately the whole system should run off of a config outside of the environment and the generated registeration can apply the environment variables.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I see the point in that, the PgStorage module is what accepts the public schema not at the table level. I wonder if this then shouldn't be moved to the PgStorage module.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. We should move it there at some point. Table shouldn't know anything about postgres implementation. |
||
| SET ${blockNumberFieldName} = 0, | ||
| ${logIndexFieldName} = 0, | ||
| ${blockTimestampFieldName} = 0, | ||
|
|
@@ -67,7 +64,6 @@ module ChainMetadata = { | |
|
|
||
| let table = mkTable( | ||
| "chain_metadata", | ||
| ~schemaName=publicSchema, | ||
| ~fields=[ | ||
| mkField("chain_id", Integer, ~fieldSchema=S.int, ~isPrimaryKey), | ||
| mkField("start_block", Integer, ~fieldSchema=S.int), | ||
|
|
@@ -103,7 +99,6 @@ module PersistedState = { | |
|
|
||
| let table = mkTable( | ||
| "persisted_state", | ||
| ~schemaName=publicSchema, | ||
| ~fields=[ | ||
| mkField("id", Serial, ~fieldSchema=S.int, ~isPrimaryKey), | ||
| mkField("envio_version", Text, ~fieldSchema=S.string), | ||
|
|
@@ -125,7 +120,6 @@ module EndOfBlockRangeScannedData = { | |
|
|
||
| let table = mkTable( | ||
| "end_of_block_range_scanned_data", | ||
| ~schemaName=publicSchema, | ||
| ~fields=[ | ||
| mkField("chain_id", Integer, ~fieldSchema=S.int, ~isPrimaryKey), | ||
| mkField("block_number", Integer, ~fieldSchema=S.int, ~isPrimaryKey), | ||
|
|
@@ -168,7 +162,6 @@ module RawEvents = { | |
|
|
||
| let table = mkTable( | ||
| PgStorage.rawEventsTableName, | ||
| ~schemaName=publicSchema, | ||
| ~fields=[ | ||
| mkField("chain_id", Integer, ~fieldSchema=S.int), | ||
| mkField("event_id", Numeric, ~fieldSchema=S.bigint), | ||
|
|
@@ -231,7 +224,6 @@ module DynamicContractRegistry = { | |
|
|
||
| let table = mkTable( | ||
| "dynamic_contract_registry", | ||
| ~schemaName=publicSchema, | ||
| ~fields=[ | ||
| mkField("id", Text, ~isPrimaryKey, ~fieldSchema=S.string), | ||
| mkField("chain_id", Integer, ~fieldSchema=S.int), | ||
|
|
@@ -250,5 +242,5 @@ module DynamicContractRegistry = { | |
| ], | ||
| ) | ||
|
|
||
| let entityHistory = table->EntityHistory.fromTable(~schema) | ||
| let entityHistory = table->EntityHistory.fromTable(~pgSchema=Env.Db.publicSchema, ~schema) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DZakh, I can't remember when this was added but don't you think eval should be at start up time and not at runtime of the insert function?