forked from cryptosharks131/lndg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bd2b3c
commit 1baebbd
Showing
16 changed files
with
632 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.2.7 on 2022-06-20 11:05 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('gui', '0027_rebalancer_manual'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='pendinghtlcs', | ||
name='forwarding_channel', | ||
field=models.CharField(max_length=20), | ||
), | ||
migrations.AlterField( | ||
model_name='rebalancer', | ||
name='fee_limit', | ||
field=models.FloatField(), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Generated by Django 3.2.7 on 2022-06-27 08:47 | ||
from django.db import migrations | ||
|
||
def update_percent_vars(apps, schedma_editor): | ||
settings = apps.get_model('gui', 'localsettings') | ||
try: | ||
if settings.objects.filter(key='AR-MaxCost%').exists(): | ||
current_value = settings.objects.filter(key='AR-MaxCost%')[0] | ||
current_value.value = int(float(current_value.value)*100) | ||
current_value.save() | ||
if settings.objects.filter(key='AR-Outbound%').exists(): | ||
current_value = settings.objects.filter(key='AR-Outbound%')[0] | ||
current_value.value = int(float(current_value.value)*100) | ||
current_value.save() | ||
if settings.objects.filter(key='AR-Target%').exists(): | ||
current_value = settings.objects.filter(key='AR-Target%')[0] | ||
current_value.value = int(float(current_value.value)*100) | ||
current_value.save() | ||
except Exception as e: | ||
print('Migration step failed:', str(e)) | ||
|
||
def revert_percent_vars(apps, schedma_editor): | ||
settings = apps.get_model('gui', 'localsettings') | ||
try: | ||
if settings.objects.filter(key='AR-MaxCost%').exists(): | ||
current_value = settings.objects.filter(key='AR-MaxCost%')[0] | ||
current_value.value = int(current_value.value)/100 | ||
current_value.save() | ||
if settings.objects.filter(key='AR-Outbound%').exists(): | ||
current_value = settings.objects.filter(key='AR-Outbound%')[0] | ||
current_value.value = int(current_value.value)/100 | ||
current_value.save() | ||
if settings.objects.filter(key='AR-Target%').exists(): | ||
current_value = settings.objects.filter(key='AR-Target%')[0] | ||
current_value.value = int(current_value.value)/100 | ||
current_value.save() | ||
except Exception as e: | ||
print('Migration reversion step failed:', str(e)) | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('gui', '0028_auto_20220620_1105'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(update_percent_vars, revert_percent_vars), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.