({
backfillLimit = 50000,
intervalMinutes = 1440,
}: {
backfillLimit?: number;
intervalMinutes?: number;
})
| 957 | } |
| 958 | |
| 959 | export async function createInternalEventsTable({ |
| 960 | backfillLimit = 50000, |
| 961 | intervalMinutes = 1440, |
| 962 | }: { |
| 963 | backfillLimit?: number; |
| 964 | intervalMinutes?: number; |
| 965 | }) { |
| 966 | logger().info("Creating internal events table and materialized view"); |
| 967 | await command({ |
| 968 | query: CREATE_INTERNAL_EVENTS_TABLE_QUERY, |
| 969 | clickhouse_settings: { wait_end_of_query: 1 }, |
| 970 | }); |
| 971 | await command({ |
| 972 | query: CREATE_INTERNAL_EVENTS_TABLE_MATERIALIZED_VIEW_QUERY, |
| 973 | clickhouse_settings: { wait_end_of_query: 1 }, |
| 974 | }); |
| 975 | logger().info("Backfilling internal events"); |
| 976 | |
| 977 | await backfillInternalEvents({ |
| 978 | forceFullBackfill: true, |
| 979 | limit: backfillLimit, |
| 980 | intervalMinutes, |
| 981 | }); |
| 982 | } |
| 983 | |
| 984 | export async function upgradeV023Pre({ |
| 985 | internalEventsBackfillLimit = 50000, |
no test coverage detected