Skip to content

Commit

Permalink
rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-escobedo committed Nov 10, 2022
1 parent 63a5639 commit 0b14c21
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/django-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Test Pytest
run: |
pipenv run pytest -k "not test_integrations"
pipenv run pytest -k customers
- name: Test Setup Tasks
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Generated by Django 4.0.5 on 2022-11-10 23:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("metering_billing", "0066_change_unique_rate_to_count"),
]

operations = [
migrations.RemoveField(
model_name="historicalinvoice",
name="external_payment_obj",
),
migrations.RemoveField(
model_name="invoice",
name="external_payment_obj",
),
migrations.AlterField(
model_name="historicalinvoice",
name="customer",
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name="historicalinvoice",
name="organization",
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name="historicalinvoice",
name="subscription",
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name="invoice",
name="customer",
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name="invoice",
name="organization",
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name="invoice",
name="subscription",
field=models.JSONField(blank=True, null=True),
),
]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Generated by Django 4.0.5 on 2022-11-10 21:00
# Generated by Django 4.0.5 on 2022-11-10 23:29

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("metering_billing", "0066_change_unique_rate_to_count"),
(
"metering_billing",
"0067_remove_historicalinvoice_external_payment_obj_and_more",
),
]

operations = [
Expand Down Expand Up @@ -40,12 +43,4 @@ class Migration(migrations.Migration):
old_name="subscription",
new_name="old_subscription",
),
migrations.RemoveField(
model_name="historicalinvoice",
name="external_payment_obj",
),
migrations.RemoveField(
model_name="invoice",
name="external_payment_obj",
),
]
82 changes: 0 additions & 82 deletions backend/metering_billing/migrations/0069_transfer_invoice_to_fk.py

This file was deleted.

27 changes: 15 additions & 12 deletions backend/metering_billing/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,15 +542,18 @@ class Invoice(models.Model):
choices=PAYMENT_PROVIDERS.choices, max_length=40, null=True, blank=True
)
line_items = models.JSONField()
organization = models.ForeignKey(
Organization, on_delete=models.CASCADE, null=True, related_name="invoices"
)
customer = models.ForeignKey(
Customer, on_delete=models.CASCADE, null=True, related_name="invoices"
)
subscription = models.ForeignKey(
"Subscription", on_delete=models.CASCADE, null=True, related_name="invoices"
)
old_organization = models.JSONField(null=True, blank=True)
old_customer = models.JSONField(null=True, blank=True)
old_subscription = models.JSONField(null=True, blank=True)
# organization = models.ForeignKey(
# Organization, on_delete=models.CASCADE, null=True, related_name="invoices"
# )
# customer = models.ForeignKey(
# Customer, on_delete=models.CASCADE, null=True, related_name="invoices"
# )
# subscription = models.ForeignKey(
# "Subscription", on_delete=models.CASCADE, null=True, related_name="invoices"
# )
history = HistoricalRecords()

def __str__(self):
Expand Down Expand Up @@ -978,9 +981,9 @@ class Backtest(models.Model):
This model is used to store the results of a backtest.
"""

backtest_name = models.CharField(max_length=100, null=False, blank=False)
start_date = models.DateField(null=False, blank=False)
end_date = models.DateField(null=False, blank=False)
backtest_name = models.CharField(max_length=100)
start_date = models.DateField()
end_date = models.DateField()
organization = models.ForeignKey(
Organization, on_delete=models.CASCADE, null=False, related_name="org_backtests"
)
Expand Down

0 comments on commit 0b14c21

Please sign in to comment.