Merge branch 'master' into nymkappa/bugfix/historical-price-bitcoin-only

This commit is contained in:
wiz 2023-02-24 16:29:42 +09:00 committed by GitHub
commit 20404cf6a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View File

@ -86,7 +86,7 @@ class DatabaseMigration {
try { try {
await this.$migrateTableSchemaFromVersion(databaseSchemaVersion); await this.$migrateTableSchemaFromVersion(databaseSchemaVersion);
if (databaseSchemaVersion === 0) { if (databaseSchemaVersion === 0) {
logger.notice(`MIGRATIONS: OK. Database schema has been properly initialized to version ${DatabaseMigration.currentVersion} (latest version)`); logger.notice(`MIGRATIONS: OK. Database schema has been properly initialized to version ${DatabaseMigration.currentVersion} (latest version)`);
} else { } else {
logger.notice(`MIGRATIONS: OK. Database schema have been migrated from version ${databaseSchemaVersion} to ${DatabaseMigration.currentVersion} (latest version)`); logger.notice(`MIGRATIONS: OK. Database schema have been migrated from version ${databaseSchemaVersion} to ${DatabaseMigration.currentVersion} (latest version)`);
} }
@ -300,7 +300,7 @@ class DatabaseMigration {
await this.$executeQuery('ALTER TABLE `lightning_stats` ADD med_base_fee_mtokens bigint(20) unsigned NOT NULL DEFAULT "0"'); await this.$executeQuery('ALTER TABLE `lightning_stats` ADD med_base_fee_mtokens bigint(20) unsigned NOT NULL DEFAULT "0"');
await this.updateToSchemaVersion(27); await this.updateToSchemaVersion(27);
} }
if (databaseSchemaVersion < 28 && isBitcoin === true) { if (databaseSchemaVersion < 28 && isBitcoin === true) {
if (config.LIGHTNING.ENABLED) { if (config.LIGHTNING.ENABLED) {
this.uniqueLog(logger.notice, `'lightning_stats' and 'node_stats' tables have been truncated.`); this.uniqueLog(logger.notice, `'lightning_stats' and 'node_stats' tables have been truncated.`);
@ -464,7 +464,7 @@ class DatabaseMigration {
await this.$executeQuery('DROP TABLE IF EXISTS `transactions`'); await this.$executeQuery('DROP TABLE IF EXISTS `transactions`');
await this.$executeQuery('DROP TABLE IF EXISTS `cpfp_clusters`'); await this.$executeQuery('DROP TABLE IF EXISTS `cpfp_clusters`');
await this.updateToSchemaVersion(52); await this.updateToSchemaVersion(52);
} catch(e) { } catch (e) {
logger.warn('' + (e instanceof Error ? e.message : e)); logger.warn('' + (e instanceof Error ? e.message : e));
} }
} }
@ -476,9 +476,11 @@ class DatabaseMigration {
if (databaseSchemaVersion < 54) { if (databaseSchemaVersion < 54) {
this.uniqueLog(logger.notice, `'prices' table has been truncated`); this.uniqueLog(logger.notice, `'prices' table has been truncated`);
this.uniqueLog(logger.notice, `'blocks_prices' table has been truncated`);
await this.$executeQuery(`TRUNCATE prices`); await this.$executeQuery(`TRUNCATE prices`);
await this.$executeQuery(`TRUNCATE blocks_prices`); if (isBitcoin === true) {
this.uniqueLog(logger.notice, `'blocks_prices' table has been truncated`);
await this.$executeQuery(`TRUNCATE blocks_prices`);
}
await this.updateToSchemaVersion(54); await this.updateToSchemaVersion(54);
} }
} }
@ -604,7 +606,7 @@ class DatabaseMigration {
queries.push(`INSERT INTO state(name, number, string) VALUES ('last_hashrates_indexing', 0, NULL)`); queries.push(`INSERT INTO state(name, number, string) VALUES ('last_hashrates_indexing', 0, NULL)`);
} }
if (version < 9 && isBitcoin === true) { if (version < 9 && isBitcoin === true) {
queries.push(`INSERT INTO state(name, number, string) VALUES ('last_weekly_hashrates_indexing', 0, NULL)`); queries.push(`INSERT INTO state(name, number, string) VALUES ('last_weekly_hashrates_indexing', 0, NULL)`);
} }

View File

@ -1,4 +1,4 @@
<div class="holder" [ngStyle]="{'width': size, 'height': size}"> <div class="holder" [ngStyle]="{'width': size, 'height': size}">
<img *ngIf="imageUrl" [src]="imageUrl"> <img *ngIf="imageUrl" [src]="imageUrl">
<canvas #canvas></canvas> <canvas #canvas [style]="{'border': border + 'px solid white'}"></canvas>
</div> </div>

View File

@ -12,6 +12,7 @@ export class QrcodeComponent implements AfterViewInit {
@Input() data: string; @Input() data: string;
@Input() size = 125; @Input() size = 125;
@Input() imageUrl: string; @Input() imageUrl: string;
@Input() border = 0;
@ViewChild('canvas') canvas: ElementRef; @ViewChild('canvas') canvas: ElementRef;
qrcodeObject: any; qrcodeObject: any;