Skip to content

Commit

Permalink
chore(data-warehouse): Adds an updated_at field to warehouse models (P…
Browse files Browse the repository at this point in the history
…ostHog#23945)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and silentninja committed Aug 8, 2024
1 parent 81ed316 commit da7cc9c
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 8 deletions.
2 changes: 1 addition & 1 deletion latest_migrations.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ contenttypes: 0002_remove_content_type_name
ee: 0016_rolemembership_organization_member
otp_static: 0002_throttling
otp_totp: 0002_auto_20190420_0723
posthog: 0450_externaldataschema_sync_frequency_interval_and_more
posthog: 0451_datawarehousetable_updated_at_and_more
sessions: 0001_initial
social_django: 0010_uid_db_index
two_factor: 0007_auto_20201201_1019
32 changes: 32 additions & 0 deletions posthog/migrations/0451_datawarehousetable_updated_at_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.2.14 on 2024-07-24 11:20

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("posthog", "0450_externaldataschema_sync_frequency_interval_and_more"),
]

operations = [
migrations.AddField(
model_name="datawarehousetable",
name="updated_at",
field=models.DateTimeField(auto_now=True, null=True, blank=True),
),
migrations.AddField(
model_name="externaldatajob",
name="updated_at",
field=models.DateTimeField(auto_now=True, null=True, blank=True),
),
migrations.AddField(
model_name="externaldataschema",
name="updated_at",
field=models.DateTimeField(auto_now=True, null=True, blank=True),
),
migrations.AddField(
model_name="externaldatasource",
name="updated_at",
field=models.DateTimeField(auto_now=True, null=True, blank=True),
),
]
7 changes: 7 additions & 0 deletions posthog/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ class Meta:
abstract = True


class UpdatedMetaFields(models.Model):
updated_at: models.DateTimeField = models.DateTimeField(auto_now=True, null=True, blank=True)

class Meta:
abstract = True


class DeletedMetaFields(models.Model):
deleted: models.BooleanField = models.BooleanField(null=True, blank=True)

Expand Down
Loading

0 comments on commit da7cc9c

Please sign in to comment.