Remove obsolete migration files and update initial migration timestamps for various modules; ensure consistency in migration history across the project.

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-20 23:32:45 +00:00
parent b38553cfc3
commit d14d6d89b1
67 changed files with 12722 additions and 3414 deletions

View File

@@ -1,4 +1,4 @@
# Generated by Django 5.2.7 on 2025-11-02 21:42
# Generated by Django 5.2.8 on 2025-11-20 23:27
import django.db.models.deletion
from django.conf import settings
@@ -16,42 +16,196 @@ class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
name='SystemLog',
name='SystemSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255, unique=True)),
('value', models.JSONField(default=dict, help_text='Settings value as JSON')),
('description', models.TextField(blank=True, help_text='Description of this setting')),
('updated_at', models.DateTimeField(auto_now=True)),
('module', models.CharField(choices=[('planner', 'Planner'), ('writer', 'Writer'), ('thinker', 'Thinker'), ('ai', 'AI Pipeline'), ('wp_bridge', 'WordPress Bridge'), ('system', 'System')], db_index=True, max_length=50)),
('level', models.CharField(choices=[('info', 'Info'), ('warning', 'Warning'), ('error', 'Error'), ('success', 'Success')], db_index=True, default='info', max_length=20)),
('action', models.CharField(max_length=255)),
('message', models.TextField()),
('metadata', models.JSONField(blank=True, default=dict)),
('tenant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'db_table': 'igny8_system_logs',
'ordering': ['-created_at'],
'indexes': [models.Index(fields=['tenant', 'module', 'level', '-created_at'], name='igny8_syste_tenant__1a6cda_idx')],
'db_table': 'igny8_system_settings',
'ordering': ['key'],
'indexes': [models.Index(fields=['key'], name='igny8_syste_key_20500b_idx')],
},
),
migrations.CreateModel(
name='SystemStatus',
name='AccountSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('config', models.JSONField(default=dict, help_text='Settings configuration as JSON')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
],
options={
'db_table': 'igny8_account_settings',
'ordering': ['key'],
'indexes': [models.Index(fields=['account', 'key'], name='igny8_accou_tenant__308b8f_idx')],
'unique_together': {('account', 'key')},
},
),
migrations.CreateModel(
name='AIPrompt',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('prompt_type', models.CharField(choices=[('clustering', 'Clustering'), ('ideas', 'Ideas Generation'), ('content_generation', 'Content Generation'), ('image_prompt_extraction', 'Image Prompt Extraction'), ('image_prompt_template', 'Image Prompt Template'), ('negative_prompt', 'Negative Prompt'), ('site_structure_generation', 'Site Structure Generation'), ('product_generation', 'Product Content Generation'), ('service_generation', 'Service Page Generation'), ('taxonomy_generation', 'Taxonomy Generation')], db_index=True, max_length=50)),
('prompt_value', models.TextField(help_text='The prompt template text')),
('default_prompt', models.TextField(help_text='Default prompt value (for reset)')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
],
options={
'db_table': 'igny8_ai_prompts',
'ordering': ['prompt_type'],
'indexes': [models.Index(fields=['prompt_type'], name='igny8_ai_pr_prompt__4b2dbe_idx'), models.Index(fields=['account', 'prompt_type'], name='igny8_ai_pr_tenant__9e7b95_idx')],
'unique_together': {('account', 'prompt_type')},
},
),
migrations.CreateModel(
name='AISettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('integration_type', models.CharField(db_index=True, help_text="Integration type (e.g., 'openai', 'runware')", max_length=50)),
('config', models.JSONField(default=dict, help_text='Integration configuration (API keys, settings, etc.)')),
('model_preferences', models.JSONField(default=dict, help_text='Model preferences per operation type')),
('cost_limits', models.JSONField(default=dict, help_text='Cost limits and budgets')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
],
options={
'db_table': 'igny8_ai_settings',
'ordering': ['integration_type'],
'indexes': [models.Index(fields=['integration_type'], name='igny8_ai_se_integra_4f0b21_idx'), models.Index(fields=['account', 'integration_type'], name='igny8_ai_se_tenant__05ae98_idx')],
'unique_together': {('account', 'integration_type')},
},
),
migrations.CreateModel(
name='AuthorProfile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text="Profile name (e.g., 'SaaS B2B Informative')", max_length=255)),
('description', models.TextField(blank=True, help_text='Description of the writing style')),
('tone', models.CharField(help_text="Writing tone (e.g., 'Professional', 'Casual', 'Technical', 'Conversational')", max_length=100)),
('language', models.CharField(default='en', help_text="Language code (e.g., 'en', 'es', 'fr')", max_length=50)),
('structure_template', models.JSONField(default=dict, help_text='Structure template defining content sections and their order')),
('is_active', models.BooleanField(db_index=True, default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
],
options={
'verbose_name': 'Author Profile',
'verbose_name_plural': 'Author Profiles',
'db_table': 'igny8_author_profiles',
'ordering': ['name'],
'indexes': [models.Index(fields=['account', 'is_active'], name='igny8_autho_tenant__97d2c2_idx'), models.Index(fields=['name'], name='igny8_autho_name_8295f3_idx')],
},
),
migrations.CreateModel(
name='IntegrationSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('integration_type', models.CharField(choices=[('openai', 'OpenAI'), ('runware', 'Runware'), ('gsc', 'Google Search Console'), ('image_generation', 'Image Generation Service')], db_index=True, max_length=50)),
('config', models.JSONField(default=dict, help_text='Integration configuration (API keys, settings, etc.)')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
],
options={
'db_table': 'igny8_integration_settings',
'ordering': ['integration_type'],
'indexes': [models.Index(fields=['integration_type'], name='igny8_integ_integra_5e382e_idx'), models.Index(fields=['account', 'integration_type'], name='igny8_integ_tenant__5da472_idx')],
'unique_together': {('account', 'integration_type')},
},
),
migrations.CreateModel(
name='ModuleEnableSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('component', models.CharField(db_index=True, max_length=100)),
('status', models.CharField(choices=[('healthy', 'Healthy'), ('warning', 'Warning'), ('error', 'Error'), ('maintenance', 'Maintenance')], default='healthy', max_length=20)),
('message', models.TextField(blank=True)),
('last_check', models.DateTimeField(auto_now=True)),
('metadata', models.JSONField(blank=True, default=dict)),
('tenant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant')),
('planner_enabled', models.BooleanField(default=True, help_text='Enable Planner module')),
('writer_enabled', models.BooleanField(default=True, help_text='Enable Writer module')),
('thinker_enabled', models.BooleanField(default=True, help_text='Enable Thinker module')),
('automation_enabled', models.BooleanField(default=True, help_text='Enable Automation module')),
('site_builder_enabled', models.BooleanField(default=True, help_text='Enable Site Builder module')),
('linker_enabled', models.BooleanField(default=True, help_text='Enable Linker module')),
('optimizer_enabled', models.BooleanField(default=True, help_text='Enable Optimizer module')),
('publisher_enabled', models.BooleanField(default=True, help_text='Enable Publisher module')),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
],
options={
'db_table': 'igny8_system_status',
'indexes': [models.Index(fields=['tenant', 'status'], name='igny8_syste_tenant__0e1889_idx')],
'unique_together': {('tenant', 'component')},
'db_table': 'igny8_module_enable_settings',
'unique_together': {('account',)},
},
),
migrations.CreateModel(
name='ModuleSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('config', models.JSONField(default=dict, help_text='Settings configuration as JSON')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('module_name', models.CharField(db_index=True, help_text="Module name (e.g., 'planner', 'writer')", max_length=100)),
('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
],
options={
'db_table': 'igny8_module_settings',
'ordering': ['module_name', 'key'],
'indexes': [models.Index(fields=['account', 'module_name', 'key'], name='igny8_modul_tenant__21ee25_idx'), models.Index(fields=['module_name', 'key'], name='igny8_modul_module__95373a_idx')],
'unique_together': {('account', 'module_name', 'key')},
},
),
migrations.CreateModel(
name='Strategy',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Strategy name', max_length=255)),
('description', models.TextField(blank=True, help_text='Description of the content strategy')),
('prompt_types', models.JSONField(default=list, help_text="List of prompt types to use (e.g., ['clustering', 'ideas', 'content_generation'])")),
('section_logic', models.JSONField(default=dict, help_text='Section logic configuration defining content structure and flow')),
('is_active', models.BooleanField(db_index=True, default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
('sector', models.ForeignKey(blank=True, help_text='Optional: Link strategy to a specific sector', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='strategies', to='igny8_core_auth.sector')),
],
options={
'verbose_name': 'Strategy',
'verbose_name_plural': 'Strategies',
'db_table': 'igny8_strategies',
'ordering': ['name'],
'indexes': [models.Index(fields=['account', 'is_active'], name='igny8_strat_tenant__344de9_idx'), models.Index(fields=['account', 'sector'], name='igny8_strat_tenant__279cfa_idx'), models.Index(fields=['name'], name='igny8_strat_name_8fe823_idx')],
},
),
migrations.CreateModel(
name='UserSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
('value', models.JSONField(default=dict, help_text='Settings value as JSON')),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='user_settings', to='igny8_core_auth.account')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_settings', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'igny8_user_settings',
'ordering': ['key'],
'indexes': [models.Index(fields=['user', 'account', 'key'], name='igny8_user__user_id_ac09d9_idx'), models.Index(fields=['account', 'key'], name='igny8_user__tenant__01033d_idx')],
'unique_together': {('user', 'account', 'key')},
},
),
]

View File

@@ -1,61 +0,0 @@
# Generated migration for IntegrationSettings and AIPrompt models
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('igny8_core_auth', '0001_initial'),
('system', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='AIPrompt',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('prompt_type', models.CharField(choices=[('clustering', 'Clustering'), ('ideas', 'Ideas Generation'), ('content_generation', 'Content Generation'), ('image_prompt_template', 'Image Prompt Template'), ('negative_prompt', 'Negative Prompt')], db_index=True, max_length=50)),
('prompt_value', models.TextField(help_text='The prompt template text')),
('default_prompt', models.TextField(help_text='Default prompt value (for reset)')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('tenant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant')),
],
options={
'db_table': 'igny8_ai_prompts',
'ordering': ['prompt_type'],
'unique_together': {('tenant', 'prompt_type')},
'indexes': [
models.Index(fields=['prompt_type'], name='igny8_ai_pr_prompt__idx'),
models.Index(fields=['tenant', 'prompt_type'], name='igny8_ai_pr_tenant__idx'),
],
},
),
migrations.CreateModel(
name='IntegrationSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('integration_type', models.CharField(choices=[('openai', 'OpenAI'), ('runware', 'Runware'), ('gsc', 'Google Search Console')], db_index=True, max_length=50)),
('config', models.JSONField(default=dict, help_text='Integration configuration (API keys, settings, etc.)')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('tenant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant')),
],
options={
'db_table': 'igny8_integration_settings',
'ordering': ['integration_type'],
'unique_together': {('tenant', 'integration_type')},
'indexes': [
models.Index(fields=['integration_type'], name='igny8_integ_integra_idx'),
models.Index(fields=['tenant', 'integration_type'], name='igny8_integ_tenant__idx'),
],
},
),
]

View File

@@ -1,28 +0,0 @@
# Generated migration to add image_generation integration type
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('system', '0002_integration_settings_ai_prompts'),
]
operations = [
migrations.AlterField(
model_name='integrationsettings',
name='integration_type',
field=models.CharField(
choices=[
('openai', 'OpenAI'),
('runware', 'Runware'),
('gsc', 'Google Search Console'),
('image_generation', 'Image Generation Service'),
],
db_index=True,
max_length=50
),
),
]

View File

@@ -1,200 +0,0 @@
# Generated by Django 5.2.8 on 2025-11-07 10:06
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('igny8_core_auth', '0008_passwordresettoken_alter_industry_options_and_more'),
('system', '0003_add_image_generation_integration_type'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='AISettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('integration_type', models.CharField(db_index=True, help_text="Integration type (e.g., 'openai', 'runware')", max_length=50)),
('config', models.JSONField(default=dict, help_text='Integration configuration (API keys, settings, etc.)')),
('model_preferences', models.JSONField(default=dict, help_text='Model preferences per operation type')),
('cost_limits', models.JSONField(default=dict, help_text='Cost limits and budgets')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'db_table': 'igny8_ai_settings',
'ordering': ['integration_type'],
},
),
migrations.CreateModel(
name='ModuleSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('config', models.JSONField(default=dict, help_text='Settings configuration as JSON')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('module_name', models.CharField(db_index=True, help_text="Module name (e.g., 'planner', 'writer')", max_length=100)),
('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
],
options={
'db_table': 'igny8_module_settings',
'ordering': ['module_name', 'key'],
},
),
migrations.CreateModel(
name='SystemSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255, unique=True)),
('value', models.JSONField(default=dict, help_text='Settings value as JSON')),
('description', models.TextField(blank=True, help_text='Description of this setting')),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'db_table': 'igny8_system_settings',
'ordering': ['key'],
},
),
migrations.CreateModel(
name='TenantSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('config', models.JSONField(default=dict, help_text='Settings configuration as JSON')),
('is_active', models.BooleanField(default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
],
options={
'db_table': 'igny8_tenant_settings',
'ordering': ['key'],
},
),
migrations.CreateModel(
name='UserSettings',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
('value', models.JSONField(default=dict, help_text='Settings value as JSON')),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'db_table': 'igny8_user_settings',
'ordering': ['key'],
},
),
migrations.RenameIndex(
model_name='aiprompt',
new_name='igny8_ai_pr_prompt__4b2dbe_idx',
old_name='igny8_ai_pr_prompt__idx',
),
migrations.RenameIndex(
model_name='aiprompt',
new_name='igny8_ai_pr_tenant__9e7b95_idx',
old_name='igny8_ai_pr_tenant__idx',
),
migrations.RenameIndex(
model_name='integrationsettings',
new_name='igny8_integ_integra_5e382e_idx',
old_name='igny8_integ_integra_idx',
),
migrations.RenameIndex(
model_name='integrationsettings',
new_name='igny8_integ_tenant__5da472_idx',
old_name='igny8_integ_tenant__idx',
),
migrations.AlterField(
model_name='aiprompt',
name='prompt_type',
field=models.CharField(choices=[('clustering', 'Clustering'), ('ideas', 'Ideas Generation'), ('content_generation', 'Content Generation'), ('image_prompt_extraction', 'Image Prompt Extraction'), ('image_prompt_template', 'Image Prompt Template'), ('negative_prompt', 'Negative Prompt')], db_index=True, max_length=50),
),
migrations.AddField(
model_name='aisettings',
name='tenant',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant'),
),
migrations.AddField(
model_name='modulesettings',
name='tenant',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant'),
),
migrations.AddIndex(
model_name='systemsettings',
index=models.Index(fields=['key'], name='igny8_syste_key_20500b_idx'),
),
migrations.AddField(
model_name='tenantsettings',
name='tenant',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant'),
),
migrations.AddField(
model_name='usersettings',
name='tenant',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_settings', to='igny8_core_auth.tenant'),
),
migrations.AddField(
model_name='usersettings',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_settings', to=settings.AUTH_USER_MODEL),
),
migrations.RunSQL(
sql="DROP TABLE IF EXISTS igny8_system_logs CASCADE",
reverse_sql=migrations.RunSQL.noop,
),
migrations.RunSQL(
sql="DROP TABLE IF EXISTS igny8_system_status CASCADE",
reverse_sql=migrations.RunSQL.noop,
),
migrations.AddIndex(
model_name='aisettings',
index=models.Index(fields=['integration_type'], name='igny8_ai_se_integra_4f0b21_idx'),
),
migrations.AddIndex(
model_name='aisettings',
index=models.Index(fields=['tenant', 'integration_type'], name='igny8_ai_se_tenant__05ae98_idx'),
),
migrations.AlterUniqueTogether(
name='aisettings',
unique_together={('tenant', 'integration_type')},
),
migrations.AddIndex(
model_name='modulesettings',
index=models.Index(fields=['tenant', 'module_name', 'key'], name='igny8_modul_tenant__21ee25_idx'),
),
migrations.AddIndex(
model_name='modulesettings',
index=models.Index(fields=['module_name', 'key'], name='igny8_modul_module__95373a_idx'),
),
migrations.AlterUniqueTogether(
name='modulesettings',
unique_together={('tenant', 'module_name', 'key')},
),
migrations.AddIndex(
model_name='tenantsettings',
index=models.Index(fields=['tenant', 'key'], name='igny8_tenan_tenant__8ce0b3_idx'),
),
migrations.AlterUniqueTogether(
name='tenantsettings',
unique_together={('tenant', 'key')},
),
migrations.AddIndex(
model_name='usersettings',
index=models.Index(fields=['user', 'tenant', 'key'], name='igny8_user__user_id_ac09d9_idx'),
),
migrations.AddIndex(
model_name='usersettings',
index=models.Index(fields=['tenant', 'key'], name='igny8_user__tenant__01033d_idx'),
),
migrations.AlterUniqueTogether(
name='usersettings',
unique_together={('user', 'tenant', 'key')},
),
]

View File

@@ -1,77 +0,0 @@
# Generated by Django 5.2.8 on 2025-11-07 11:34
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('igny8_core_auth', '0010_add_seed_keyword'),
('system', '0004_aisettings_modulesettings_systemsettings_and_more'),
]
operations = [
migrations.CreateModel(
name='AuthorProfile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text="Profile name (e.g., 'SaaS B2B Informative')", max_length=255)),
('description', models.TextField(blank=True, help_text='Description of the writing style')),
('tone', models.CharField(help_text="Writing tone (e.g., 'Professional', 'Casual', 'Technical', 'Conversational')", max_length=100)),
('language', models.CharField(default='en', help_text="Language code (e.g., 'en', 'es', 'fr')", max_length=50)),
('structure_template', models.JSONField(default=dict, help_text='Structure template defining content sections and their order')),
('is_active', models.BooleanField(db_index=True, default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('tenant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant')),
],
options={
'verbose_name': 'Author Profile',
'verbose_name_plural': 'Author Profiles',
'db_table': 'igny8_author_profiles',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='Strategy',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Strategy name', max_length=255)),
('description', models.TextField(blank=True, help_text='Description of the content strategy')),
('prompt_types', models.JSONField(default=list, help_text="List of prompt types to use (e.g., ['clustering', 'ideas', 'content_generation'])")),
('section_logic', models.JSONField(default=dict, help_text='Section logic configuration defining content structure and flow')),
('is_active', models.BooleanField(db_index=True, default=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('sector', models.ForeignKey(blank=True, help_text='Optional: Link strategy to a specific sector', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='strategies', to='igny8_core_auth.sector')),
('tenant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant')),
],
options={
'verbose_name': 'Strategy',
'verbose_name_plural': 'Strategies',
'db_table': 'igny8_strategies',
'ordering': ['name'],
},
),
migrations.AddIndex(
model_name='authorprofile',
index=models.Index(fields=['tenant', 'is_active'], name='igny8_autho_tenant__97d2c2_idx'),
),
migrations.AddIndex(
model_name='authorprofile',
index=models.Index(fields=['name'], name='igny8_autho_name_8295f3_idx'),
),
migrations.AddIndex(
model_name='strategy',
index=models.Index(fields=['tenant', 'is_active'], name='igny8_strat_tenant__344de9_idx'),
),
migrations.AddIndex(
model_name='strategy',
index=models.Index(fields=['tenant', 'sector'], name='igny8_strat_tenant__279cfa_idx'),
),
migrations.AddIndex(
model_name='strategy',
index=models.Index(fields=['name'], name='igny8_strat_name_8fe823_idx'),
),
]

View File

@@ -1,71 +0,0 @@
# Generated by Django 5.2.8 on 2025-11-07 14:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('system', '0005_add_author_profile_strategy'),
]
operations = [
# Remove unique_together constraint if it exists and table exists
migrations.RunSQL(
"""
DO $$
BEGIN
-- Drop unique constraint if table and constraint exist
IF EXISTS (
SELECT 1 FROM information_schema.tables
WHERE table_name = 'igny8_system_status'
) AND EXISTS (
SELECT 1 FROM pg_constraint
WHERE conname LIKE '%systemstatus%tenant_id%component%'
) THEN
ALTER TABLE igny8_system_status DROP CONSTRAINT IF EXISTS igny8_system_status_tenant_id_component_key;
END IF;
END $$;
""",
reverse_sql=migrations.RunSQL.noop
),
# Only remove field if table exists
migrations.RunSQL(
"""
DO $$
BEGIN
IF EXISTS (
SELECT 1 FROM information_schema.tables
WHERE table_name = 'igny8_system_status'
) AND EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'igny8_system_status' AND column_name = 'tenant_id'
) THEN
ALTER TABLE igny8_system_status DROP COLUMN IF EXISTS tenant_id;
END IF;
END $$;
""",
reverse_sql=migrations.RunSQL.noop
),
# Delete models only if tables exist
migrations.RunSQL(
"""
DO $$
BEGIN
IF EXISTS (
SELECT 1 FROM information_schema.tables
WHERE table_name = 'igny8_system_logs'
) THEN
DROP TABLE IF EXISTS igny8_system_logs CASCADE;
END IF;
IF EXISTS (
SELECT 1 FROM information_schema.tables
WHERE table_name = 'igny8_system_status'
) THEN
DROP TABLE IF EXISTS igny8_system_status CASCADE;
END IF;
END $$;
""",
reverse_sql=migrations.RunSQL.noop
),
]

View File

@@ -1,39 +0,0 @@
# Generated manually for Phase 0: Module Enable Settings
# Using RunSQL to create table directly to avoid model resolution issues with new unified API model
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('system', '0006_alter_systemstatus_unique_together_and_more'),
('igny8_core_auth', '0008_passwordresettoken_alter_industry_options_and_more'),
]
operations = [
# Create table using raw SQL to avoid model resolution issues
# The model state is automatically discovered from models.py
migrations.RunSQL(
sql="""
CREATE TABLE IF NOT EXISTS igny8_module_enable_settings (
id BIGSERIAL PRIMARY KEY,
planner_enabled BOOLEAN NOT NULL DEFAULT TRUE,
writer_enabled BOOLEAN NOT NULL DEFAULT TRUE,
thinker_enabled BOOLEAN NOT NULL DEFAULT TRUE,
automation_enabled BOOLEAN NOT NULL DEFAULT TRUE,
site_builder_enabled BOOLEAN NOT NULL DEFAULT TRUE,
linker_enabled BOOLEAN NOT NULL DEFAULT TRUE,
optimizer_enabled BOOLEAN NOT NULL DEFAULT TRUE,
publisher_enabled BOOLEAN NOT NULL DEFAULT TRUE,
tenant_id BIGINT NOT NULL REFERENCES igny8_tenants(id) ON DELETE CASCADE,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS igny8_module_enable_settings_tenant_id_idx ON igny8_module_enable_settings(tenant_id);
CREATE INDEX IF NOT EXISTS igny8_module_enable_settings_account_created_idx ON igny8_module_enable_settings(tenant_id, created_at);
CREATE UNIQUE INDEX IF NOT EXISTS unique_account_module_enable_settings ON igny8_module_enable_settings(tenant_id);
""",
reverse_sql="DROP TABLE IF EXISTS igny8_module_enable_settings CASCADE;",
),
]

View File

@@ -1,31 +0,0 @@
# Generated manually for Phase 7: Prompt Management UI
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('system', '0007_add_module_enable_settings'),
]
operations = [
migrations.AlterField(
model_name='aiprompt',
name='prompt_type',
field=models.CharField(
choices=[
('clustering', 'Clustering'),
('ideas', 'Ideas Generation'),
('content_generation', 'Content Generation'),
('image_prompt_extraction', 'Image Prompt Extraction'),
('image_prompt_template', 'Image Prompt Template'),
('negative_prompt', 'Negative Prompt'),
('site_structure_generation', 'Site Structure Generation'),
],
db_index=True,
max_length=50
),
),
]

View File

@@ -1,34 +0,0 @@
# Generated manually for Phase 8: Universal Content Types
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('system', '0008_add_site_structure_generation_prompt_type'),
]
operations = [
migrations.AlterField(
model_name='aiprompt',
name='prompt_type',
field=models.CharField(
choices=[
('clustering', 'Clustering'),
('ideas', 'Ideas Generation'),
('content_generation', 'Content Generation'),
('image_prompt_extraction', 'Image Prompt Extraction'),
('image_prompt_template', 'Image Prompt Template'),
('negative_prompt', 'Negative Prompt'),
('site_structure_generation', 'Site Structure Generation'),
('product_generation', 'Product Content Generation'),
('service_generation', 'Service Page Generation'),
('taxonomy_generation', 'Taxonomy Generation'),
],
db_index=True,
max_length=50
),
),
]