alby-hub/db/migrations
Adithya Vardhan b1bd7c2587
feat: track last settled transaction time for apps (#2214)
* feat: track last settled transaction time for apps

* fix: use default subwallet ordering and app_id logging in event handler

* chore: rename to last_settled_transaction_at and remove last tx migration

* chore: split app settlement update and budget check

* chore: extract app display name helper into utils function
2026-04-09 16:26:45 +05:30
..
202401191539_initial_migration.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202401191539_initial_migration.sql.tmpl feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202403171120_delete_ldk_payments.go Split service into packages (#435) 2024-06-17 19:42:09 +07:00
202404021909_nullable_expires_at.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202405302121_store_decrypted_request.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202406061259_delete_content.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202406071726_vacuum.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202406301207_rename_request_methods.go feat: backend-specific capabilities (#508) 2024-07-01 20:30:40 +07:00
202407012100_transactions.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202407151352_autoincrement.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202407201604_transactions_indexes.go chore: fix some typos 2025-03-12 23:02:19 +08:00
202407262257_remove_invalid_scopes.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202408061737_add_boostagrams_and_use_json.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202408191242_transaction_failure_reason.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202408291715_app_metadata.go feat: add uncle jim internal app (#557) 2024-09-02 17:40:34 +07:00
202410141503_add_wallet_pubkey.go feat: app child key derived from wallet master key (#736) 2024-11-07 19:06:01 +07:00
202412212345_fix_types.go feat: PostgreSQL support (#922) 2025-01-16 17:17:24 +07:00
202504231037_add_indexes.go chore: do not remove app_id index on tx table 2025-04-28 22:49:02 +05:30
202504231037_hold_invoices.go feat: add hold invoices support for LND & LDK (#1298) 2025-05-26 16:51:23 +07:00
202506170342_swaps.go Swaps improvements (shifting to standalone page + one-time swaps) (#1371) 2025-07-10 20:06:12 +07:00
202508041712_delete_non_cascade_deleted_records.go fix: remove event deletion from migration (#1503) 2025-07-15 13:17:06 +07:00
202508041737_postgres_amount_bigint.go feat: add app last used time (#1498) 2025-07-14 15:26:29 +07:00
202508041738_app_last_used.go feat: add app last used time (#1498) 2025-07-14 15:26:29 +07:00
202508041739_response_events_index.go fix: speed up background deletion task (#1516) 2025-07-21 17:16:44 +07:00
202508151405_swap_xpub.go feat: autoswaps using xpubs (#1575) 2025-08-15 17:24:00 +07:00
202508192137_forwards.go feat: track forwards to display on a home page widget (#1623) 2025-08-21 16:39:03 +05:30
202509031250_transactions_updated_at_index.go chore: speed up slow list transactions query by adding updated at index (#1681) 2025-09-03 13:05:02 +05:30
202604081200_app_last_settled_transaction.go feat: track last settled transaction time for apps (#2214) 2026-04-09 16:26:45 +05:30
migrate.go feat: track last settled transaction time for apps (#2214) 2026-04-09 16:26:45 +05:30
README.md Split service into packages (#435) 2024-06-17 19:42:09 +07:00

Creating a new migration

  1. Create a new file based on the current date and time (see existing migration format)
  2. Copy the following code and update MY_ID_HERE and MY_COMMENT_HERE and DO_SOMETHING_HERE
  3. Add the ID to the list of migrations in migrate.go
package migrations

import (
  "github.com/go-gormigrate/gormigrate/v2"
  "gorm.io/gorm"
)

// MY_COMMENT_HERE
var _MY_ID_HERE = &gormigrate.Migration {
  ID: "MY_ID_HERE",
  Migrate: func(tx *gorm.DB) error {
    return DO_SOMETHING_HERE.Error;
  },
  Rollback: func(tx *gorm.DB) error {
    return nil;
  },
}