Skip to content

Commit

Permalink
add balnk field to nullable fields (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometheo authored Jul 25, 2024
1 parent d73321d commit aacaf29
Show file tree
Hide file tree
Showing 14 changed files with 676 additions and 0 deletions.
23 changes: 23 additions & 0 deletions accounts/migrations/0006_alter_account_near_social_profile_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0.6 on 2024-07-25 17:16

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("accounts", "0005_alter_account_chain"),
]

operations = [
migrations.AlterField(
model_name="account",
name="near_social_profile_data",
field=models.JSONField(
blank=True,
help_text="NEAR social data contained under 'profile' key.",
null=True,
verbose_name="NEAR social profile data",
),
),
]
1 change: 1 addition & 0 deletions accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Account(models.Model):
near_social_profile_data = models.JSONField(
_("NEAR social profile data"),
null=True,
blank=True,
help_text=_("NEAR social data contained under 'profile' key."),
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 5.0.6 on 2024-07-25 17:16

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("activities", "0004_alter_activity_tx_hash"),
]

operations = [
migrations.AlterField(
model_name="activity",
name="action_result",
field=models.JSONField(
blank=True,
help_text="Activity action result.",
null=True,
verbose_name="action result",
),
),
migrations.AlterField(
model_name="activity",
name="tx_hash",
field=models.CharField(
blank=True,
help_text="Transaction hash.",
max_length=64,
null=True,
verbose_name="transaction hash",
),
),
]
2 changes: 2 additions & 0 deletions activities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ class Activity(models.Model):
action_result = models.JSONField(
_("action result"),
null=True,
blank=True,
help_text=_("Activity action result."),
)
tx_hash = models.CharField(
_("transaction hash"),
max_length=64,
null=True,
blank=True,
help_text=_("Transaction hash."),
)
type = models.CharField(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Generated by Django 5.0.6 on 2024-07-25 17:16

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("accounts", "0006_alter_account_near_social_profile_data"),
("donations", "0012_update_donations_net_amount"),
("pots", "0012_alter_pot_base_currency_alter_pot_chef_and_more"),
]

operations = [
migrations.AlterField(
model_name="donation",
name="chef",
field=models.ForeignKey(
blank=True,
help_text="Donation chef.",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="chef_donations",
to="accounts.account",
),
),
migrations.AlterField(
model_name="donation",
name="chef_fee",
field=models.CharField(
blank=True,
help_text="Chef fee.",
max_length=64,
null=True,
verbose_name="chef fee",
),
),
migrations.AlterField(
model_name="donation",
name="chef_fee_usd",
field=models.DecimalField(
blank=True,
decimal_places=2,
help_text="Chef fee in USD.",
max_digits=20,
null=True,
verbose_name="chef fee in USD",
),
),
migrations.AlterField(
model_name="donation",
name="message",
field=models.TextField(
blank=True,
help_text="Donation message.",
max_length=1024,
null=True,
verbose_name="message",
),
),
migrations.AlterField(
model_name="donation",
name="net_amount_usd",
field=models.DecimalField(
blank=True,
decimal_places=2,
help_text="Net amount in USD.",
max_digits=20,
null=True,
verbose_name="net amount in USD",
),
),
migrations.AlterField(
model_name="donation",
name="pot",
field=models.ForeignKey(
blank=True,
help_text="Donation pot.",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="donations",
to="pots.pot",
),
),
migrations.AlterField(
model_name="donation",
name="protocol_fee_usd",
field=models.DecimalField(
blank=True,
decimal_places=2,
help_text="Protocol fee in USD.",
max_digits=20,
null=True,
verbose_name="protocol fee in USD",
),
),
migrations.AlterField(
model_name="donation",
name="recipient",
field=models.ForeignKey(
blank=True,
help_text="Donation recipient.",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="received_donations",
to="accounts.account",
),
),
migrations.AlterField(
model_name="donation",
name="referrer",
field=models.ForeignKey(
blank=True,
help_text="Donation referrer.",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="referral_donations",
to="accounts.account",
),
),
migrations.AlterField(
model_name="donation",
name="referrer_fee",
field=models.CharField(
blank=True,
help_text="Referrer fee.",
max_length=64,
null=True,
verbose_name="referrer fee",
),
),
migrations.AlterField(
model_name="donation",
name="referrer_fee_usd",
field=models.DecimalField(
blank=True,
decimal_places=2,
help_text="Referrer fee in USD.",
max_digits=20,
null=True,
verbose_name="referrer fee in USD",
),
),
migrations.AlterField(
model_name="donation",
name="total_amount_usd",
field=models.DecimalField(
blank=True,
db_index=True,
decimal_places=2,
help_text="Total amount in USD.",
max_digits=20,
null=True,
verbose_name="total amount in USD",
),
),
migrations.AlterField(
model_name="donation",
name="tx_hash",
field=models.CharField(
blank=True,
help_text="Transaction hash.",
max_length=64,
null=True,
verbose_name="transaction hash",
),
),
]
13 changes: 13 additions & 0 deletions donations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Donation(models.Model):
max_digits=20,
decimal_places=2,
null=True,
blank=True,
help_text=_("Total amount in USD."),
db_index=True,
)
Expand All @@ -61,6 +62,7 @@ class Donation(models.Model):
max_digits=20,
decimal_places=2,
null=True,
blank=True,
help_text=_("Net amount in USD."),
)
# ft = models.ForeignKey(
Expand All @@ -83,6 +85,7 @@ class Donation(models.Model):
on_delete=models.CASCADE,
related_name="donations",
null=True,
blank=True,
help_text=_("Donation pot."),
db_index=True,
)
Expand All @@ -96,6 +99,7 @@ class Donation(models.Model):
_("message"),
max_length=1024,
null=True,
blank=True,
help_text=_("Donation message."),
)
donated_at = models.DateTimeField(
Expand All @@ -109,6 +113,7 @@ class Donation(models.Model):
on_delete=models.CASCADE,
related_name="received_donations",
null=True,
blank=True,
help_text=_("Donation recipient."),
db_index=True,
)
Expand All @@ -123,52 +128,60 @@ class Donation(models.Model):
max_digits=20,
decimal_places=2,
null=True,
blank=True,
help_text=_("Protocol fee in USD."),
)
referrer = models.ForeignKey(
Account,
on_delete=models.CASCADE,
related_name="referral_donations",
null=True,
blank=True,
help_text=_("Donation referrer."),
)
referrer_fee = models.CharField(
_("referrer fee"),
max_length=64,
null=True,
blank=True,
help_text=_("Referrer fee."),
)
referrer_fee_usd = models.DecimalField(
_("referrer fee in USD"),
max_digits=20,
decimal_places=2,
null=True,
blank=True,
help_text=_("Referrer fee in USD."),
)
chef = models.ForeignKey(
Account,
on_delete=models.CASCADE,
related_name="chef_donations",
null=True,
blank=True,
help_text=_("Donation chef."),
)
chef_fee = models.CharField(
_("chef fee"),
max_length=64,
null=True,
blank=True,
help_text=_("Chef fee."),
)
chef_fee_usd = models.DecimalField(
_("chef fee in USD"),
max_digits=20,
decimal_places=2,
null=True,
blank=True,
help_text=_("Chef fee in USD."),
)
tx_hash = models.CharField(
_("transaction hash"),
max_length=64,
null=True,
blank=True,
help_text=_("Transaction hash."),
)

Expand Down
23 changes: 23 additions & 0 deletions indexer_app/migrations/0003_alter_blockheight_block_timestamp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0.6 on 2024-07-25 17:16

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("indexer_app", "0002_blockheight_block_timestamp"),
]

operations = [
migrations.AlterField(
model_name="blockheight",
name="block_timestamp",
field=models.DateTimeField(
blank=True,
help_text="date equivalent of the block height.",
null=True,
verbose_name="block timestamp",
),
),
]
1 change: 1 addition & 0 deletions indexer_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class BlockHeight(models.Model):
_("block timestamp"),
help_text=_("date equivalent of the block height."),
null=True,
blank=True,
)
updated_at = models.DateTimeField(
_("updated at"),
Expand Down
Loading

0 comments on commit aacaf29

Please sign in to comment.