feat: add hourly portfolio sync history
This commit is contained in:
@@ -7,6 +7,7 @@ import { DatabaseSync } from 'node:sqlite';
|
||||
import { PrismaClient } from '../generated/prisma/client';
|
||||
|
||||
const migration = '20260924170000_persist_tbank_data';
|
||||
const nextMigration = '20261007181218_add_portfolio_value_history';
|
||||
const migrations = join(__dirname, '../prisma/migrations');
|
||||
const preserved = [
|
||||
'User',
|
||||
@@ -237,6 +238,12 @@ describe('T-Bank additive migration on real SQLite', () => {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
db = new DatabaseSync(file);
|
||||
db.exec('PRAGMA foreign_keys=ON');
|
||||
const beforeNext = snapshot();
|
||||
db.exec(
|
||||
readFileSync(join(migrations, nextMigration, 'migration.sql'), 'utf8'),
|
||||
);
|
||||
expect(snapshot()).toEqual(beforeNext);
|
||||
const plan = db
|
||||
.prepare(
|
||||
'EXPLAIN QUERY PLAN SELECT * FROM TbankOperation WHERE userId=? AND revision=? AND accountId=? ORDER BY occurredAt, brokerOperationId LIMIT 50',
|
||||
|
||||
Reference in New Issue
Block a user