File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,15 @@ func (m *Migration) Init() error {
304
304
PRIMARY KEY("multisig_address", "block_height")
305
305
)
306
306
` ,
307
+ `
308
+ CREATE INDEX "node_registry_height_idx" ON "node_registry" ("height")
309
+ ` ,
310
+ `
311
+ CREATE INDEX "skipped_blocksmith_block_height_idx" ON "skipped_blocksmith" ("block_height")
312
+ ` ,
313
+ `
314
+ CREATE INDEX "published_receipt_block_height_idx" ON "published_receipt" ("block_height")
315
+ ` ,
307
316
}
308
317
return nil
309
318
}
@@ -341,12 +350,14 @@ func (m *Migration) Apply() error {
341
350
return err
342
351
}
343
352
if m .CurrentVersion != nil {
353
+ * m .CurrentVersion ++
344
354
err = m .Query .ExecuteTransaction (`UPDATE "migration"
345
- SET "version" = ?, "created_date" = datetime('now');` , * m .CurrentVersion + 1 )
355
+ SET "version" = ?, "created_date" = datetime('now');` , m .CurrentVersion )
346
356
if err != nil {
347
357
return err
348
358
}
349
359
} else {
360
+ m .CurrentVersion = & version // should 0 value not nil anymore
350
361
err = m .Query .ExecuteTransaction (`
351
362
INSERT INTO "migration" (
352
363
"version",
@@ -362,7 +373,6 @@ func (m *Migration) Apply() error {
362
373
}
363
374
}
364
375
365
- m .CurrentVersion = & version
366
376
err = m .Query .CommitTx ()
367
377
if err != nil {
368
378
return err
You can’t perform that action at this time.
0 commit comments