Update app labels for billing, writer, and planner models; fix foreign key references in automation migrations
- Set app labels for CreditTransaction and CreditUsageLog models to 'billing'. - Updated app labels for Tasks, Content, and Images models to 'writer'. - Changed foreign key references in automation migrations from 'account' to 'tenant' for consistency.
This commit is contained in:
@@ -24,6 +24,7 @@ class CreditTransaction(AccountBaseModel):
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'billing'
|
||||
db_table = 'igny8_credit_transactions'
|
||||
ordering = ['-created_at']
|
||||
indexes = [
|
||||
@@ -61,6 +62,7 @@ class CreditUsageLog(AccountBaseModel):
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'billing'
|
||||
db_table = 'igny8_credit_usage_logs'
|
||||
ordering = ['-created_at']
|
||||
indexes = [
|
||||
|
||||
@@ -29,7 +29,7 @@ class Tasks(SiteSectorBaseModel):
|
||||
description = models.TextField(blank=True, null=True)
|
||||
keywords = models.CharField(max_length=500, blank=True) # Comma-separated keywords (legacy)
|
||||
cluster = models.ForeignKey(
|
||||
'planning.Clusters',
|
||||
'planner.Clusters',
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
blank=True,
|
||||
@@ -37,13 +37,13 @@ class Tasks(SiteSectorBaseModel):
|
||||
limit_choices_to={'sector': models.F('sector')}
|
||||
)
|
||||
keyword_objects = models.ManyToManyField(
|
||||
'planning.Keywords',
|
||||
'planner.Keywords',
|
||||
blank=True,
|
||||
related_name='tasks',
|
||||
help_text="Individual keywords linked to this task"
|
||||
)
|
||||
idea = models.ForeignKey(
|
||||
'planning.ContentIdeas',
|
||||
'planner.ContentIdeas',
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
blank=True,
|
||||
@@ -68,6 +68,7 @@ class Tasks(SiteSectorBaseModel):
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'writer'
|
||||
db_table = 'igny8_tasks'
|
||||
ordering = ['-created_at']
|
||||
verbose_name = 'Task'
|
||||
@@ -115,6 +116,7 @@ class Content(SiteSectorBaseModel):
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'writer'
|
||||
db_table = 'igny8_content'
|
||||
ordering = ['-generated_at']
|
||||
verbose_name = 'Content'
|
||||
@@ -172,6 +174,7 @@ class Images(SiteSectorBaseModel):
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'writer'
|
||||
db_table = 'igny8_images'
|
||||
ordering = ['content', 'position', '-created_at']
|
||||
verbose_name = 'Image'
|
||||
|
||||
@@ -15,6 +15,7 @@ class Clusters(SiteSectorBaseModel):
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'planner'
|
||||
db_table = 'igny8_clusters'
|
||||
ordering = ['name']
|
||||
verbose_name = 'Cluster'
|
||||
@@ -74,6 +75,7 @@ class Keywords(SiteSectorBaseModel):
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'planner'
|
||||
db_table = 'igny8_keywords'
|
||||
ordering = ['-created_at']
|
||||
verbose_name = 'Keyword'
|
||||
@@ -178,6 +180,7 @@ class ContentIdeas(SiteSectorBaseModel):
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'planner'
|
||||
db_table = 'igny8_content_ideas'
|
||||
ordering = ['-created_at']
|
||||
verbose_name = 'Content Idea'
|
||||
|
||||
@@ -31,7 +31,7 @@ class Migration(migrations.Migration):
|
||||
('last_executed_at', models.DateTimeField(blank=True, null=True)),
|
||||
('execution_count', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
|
||||
('metadata', models.JSONField(default=dict, help_text='Additional metadata')),
|
||||
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
|
||||
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant')),
|
||||
('site', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='igny8_core_auth.site')),
|
||||
('sector', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='igny8_core_auth.sector')),
|
||||
],
|
||||
@@ -54,7 +54,7 @@ class Migration(migrations.Migration):
|
||||
('result', models.JSONField(default=dict, help_text='Execution result data')),
|
||||
('error_message', models.TextField(blank=True, help_text='Error message if execution failed', null=True)),
|
||||
('metadata', models.JSONField(default=dict, help_text='Additional metadata')),
|
||||
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
|
||||
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant')),
|
||||
('automation_rule', models.ForeignKey(help_text='The automation rule this task belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='scheduled_tasks', to='automation.automationrule')),
|
||||
],
|
||||
options={
|
||||
|
||||
Reference in New Issue
Block a user