mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopdb: add ability to track manual migrations
This commit is contained in:
parent
4f5c806ba5
commit
c650cdc8a8
11 changed files with 151 additions and 0 deletions
|
|
@ -515,6 +515,22 @@ func TestBatchUpdateCost(t *testing.T) {
|
|||
require.Equal(t, updateMap[hash2], swapsMap[hash2].State().Cost)
|
||||
}
|
||||
|
||||
// TestMigrationTracker tests the migration tracker functionality.
|
||||
func TestMigrationTracker(t *testing.T) {
|
||||
ctxb := context.Background()
|
||||
|
||||
// Create a new sqlite store for testing.
|
||||
sqlDB := NewTestDB(t)
|
||||
hasMigration, err := sqlDB.HasMigration(ctxb, "test")
|
||||
require.NoError(t, err)
|
||||
require.False(t, hasMigration)
|
||||
|
||||
require.NoError(t, sqlDB.SetMigration(ctxb, "test"))
|
||||
hasMigration, err = sqlDB.HasMigration(ctxb, "test")
|
||||
require.NoError(t, err)
|
||||
require.True(t, hasMigration)
|
||||
}
|
||||
|
||||
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
|
||||
func randomString(length int) string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue