feat: manage owner usage history records
This commit is contained in:
@@ -17,6 +17,9 @@ const MIGRATION_CHECKSUM =
|
||||
const MIGRATION_V2 = "002_legacy_import_and_bookings";
|
||||
const MIGRATION_V2_CHECKSUM =
|
||||
"cfc38024984c883490cb46ab8ab1fca2e72c67f10dc3a43c179b12a8e6f2405b";
|
||||
const MIGRATION_V3 = "003_delete_usage_record";
|
||||
const MIGRATION_V3_CHECKSUM =
|
||||
"9110464c03ed18385fbc2da1d4369715fcbf83148d7a0f2550c25710a5f54148";
|
||||
|
||||
const expectedColumns = {
|
||||
bookings: [
|
||||
@@ -334,11 +337,12 @@ try {
|
||||
calculate_multiplier: { volatility: "s" },
|
||||
create_usage_record: { volatility: "v" },
|
||||
create_usage_record_v2: { volatility: "v" },
|
||||
delete_usage_record: { volatility: "v" },
|
||||
ensure_booking_for_usage: { volatility: "v" },
|
||||
open_entitlement_period: { volatility: "v" }
|
||||
};
|
||||
const functionsValid =
|
||||
functionResult.rowCount === 5
|
||||
functionResult.rowCount === 6
|
||||
&& functionResult.rows.every(row =>
|
||||
expectedFunctions[row.function_name]?.volatility === row.volatility
|
||||
&& row.security_definer === false
|
||||
@@ -371,13 +375,16 @@ try {
|
||||
&& businessCounts.usage_record_count === 157
|
||||
&& businessCounts.ledger_count === 547,
|
||||
migrationVerified:
|
||||
migrationResult.rowCount === 2
|
||||
migrationResult.rowCount === 3
|
||||
&& migrationResult.rows.some(row =>
|
||||
row.version === MIGRATION_VERSION && row.checksum === MIGRATION_CHECKSUM
|
||||
)
|
||||
&& migrationResult.rows.some(row =>
|
||||
row.version === MIGRATION_V2 && row.checksum === MIGRATION_V2_CHECKSUM
|
||||
)
|
||||
&& migrationResult.rows.some(row =>
|
||||
row.version === MIGRATION_V3 && row.checksum === MIGRATION_V3_CHECKSUM
|
||||
)
|
||||
};
|
||||
|
||||
process.stdout.write(`${JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user