Skip to content

Commit

Permalink
changing default app version to v2 (#191)
Browse files Browse the repository at this point in the history
* changing default app version to v2

* updating fill employee query

* migration files
  • Loading branch information
labhvam5 authored Nov 16, 2022
1 parent 33bef81 commit ec712ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions apps/workspaces/migrations/0031_auto_20221116_0649.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
3 changes: 1 addition & 2 deletions apps/workspaces/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

0 comments on commit ec712ee

Please sign in to comment.