feat(bot): add control-plane schema and hasura tracking
This commit is contained in:
@@ -92,6 +92,9 @@ async function main() {
|
||||
const PUBLIC_DLOB_SOURCE_HEADER = 'X-Hasura-Dlob-Source';
|
||||
|
||||
const apiTokensTable = { schema: 'public', name: 'api_tokens' };
|
||||
const botConfigTable = { schema: 'public', name: 'bot_config' };
|
||||
const botStateTable = { schema: 'public', name: 'bot_state' };
|
||||
const botEventsTable = { schema: 'public', name: 'bot_events' };
|
||||
const source = 'default';
|
||||
|
||||
const baseTicks = { schema: 'public', name: 'drift_ticks' };
|
||||
@@ -460,6 +463,12 @@ async function main() {
|
||||
'raw',
|
||||
], { publicFilter: dlobPublicFilter });
|
||||
|
||||
// Bot control-plane tables (tracked; permissions are intentionally not created here by default).
|
||||
for (const t of [botConfigTable, botStateTable, botEventsTable]) {
|
||||
await metadataIgnore({ type: 'pg_untrack_table', args: { source, table: t } });
|
||||
await metadata({ type: 'pg_track_table', args: { source, table: t } });
|
||||
}
|
||||
|
||||
// Return table type for candle functions (needed for Hasura to track the function).
|
||||
await metadataIgnore({ type: 'pg_track_table', args: { source, table: candlesReturnTable } });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user