diff --git a/apps/workspaces/migrations/0031_auto_20221116_0649.py b/apps/workspaces/migrations/0031_auto_20221116_0649.py new file mode 100644 index 00000000..d4a84450 --- /dev/null +++ b/apps/workspaces/migrations/0031_auto_20221116_0649.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.14 on 2022-11-16 06:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('workspaces', '0030_auto_20221102_1924'), + ] + + operations = [ + migrations.AlterField( + model_name='workspace', + name='app_version', + field=models.CharField(choices=[('v1', 'v1'), ('v2', 'v2')], default='v2', help_text='App version', max_length=2), + ), + ] diff --git a/apps/workspaces/models.py b/apps/workspaces/models.py index 00748293..996bae57 100644 --- a/apps/workspaces/models.py +++ b/apps/workspaces/models.py @@ -49,8 +49,7 @@ class Workspace(models.Model): fyle_org_id = models.CharField(max_length=255, help_text='org id', unique=True) fyle_currency = models.CharField(max_length=5, help_text='Fyle Currency', null=True) xero_currency = models.CharField(max_length=5, help_text='Xero Currency', null=True) - # TODO change the default key to V2 - app_version = models.CharField(max_length=2, help_text='App version', default='v1', choices=APP_VERSION_CHOICES) + app_version = models.CharField(max_length=2, help_text='App version', default='v2', choices=APP_VERSION_CHOICES) xero_short_code = models.CharField(max_length=30, help_text='Xero short code', null=True, blank=True) last_synced_at = models.DateTimeField(help_text='Datetime when expenses were pulled last', null=True) ccc_last_synced_at = models.DateTimeField(help_text='Datetime when ccc expenses were pulled last', null=True) diff --git a/sql/scripts/015_fill_employee_name_in_expenses_and_expense_groups.sql b/sql/scripts/015_fill_employee_name_in_expenses_and_expense_groups.sql index 13b8757b..0104e066 100644 --- a/sql/scripts/015_fill_employee_name_in_expenses_and_expense_groups.sql +++ b/sql/scripts/015_fill_employee_name_in_expenses_and_expense_groups.sql @@ -24,6 +24,7 @@ where with ex as ( select expense_groups.employee_name as employee_name + expenses.id as expense_id from expense_groups inner join expense_groups_expenses on expense_groups.id = expense_groups_expenses.expensegroup_id @@ -32,5 +33,5 @@ with ex as ( update expenses set - employee_name = ex.employee_name + employee_name = ex.employee_name where id = ex.expense_id from ex;