- infrasynth.configs: typed multi-tenant config store (registry, service, secrets, cache) + public config_changed/config_reset signals and API - emit the declared-but-dead signals (features flags/overrides, scheduler task_completed/task_failed, tenancy tenant_updated, audit model_changed) and per-model audit field exclusions - security: permission catalog (security_permission), Django-style model-derived AutoPermission, PermissionRegistry, RoleAssignment, global-or-tenant Grant/Revoke, catalog API - consolidate the permission surface: PermissionRegistry only (drop the settings dict), IsAuthenticatedAndPermitted aliases HybridPermission, require_permission replaced by required_permissions + require_all - packaging: add [build-system]; add Forgejo publish workflow (.forgejo)
56 lines
2 KiB
Python
56 lines
2 KiB
Python
# Generated by Django 5.2.17 on 2026-09-24 17:48
|
|
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
dependencies = [
|
|
("tenancy", "0001_initial"),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="ConfigValue",
|
|
fields=[
|
|
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
("key", models.CharField(db_index=True, max_length=200)),
|
|
("value", models.JSONField(default=dict)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"tenant",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="+",
|
|
to="tenancy.tenant",
|
|
),
|
|
),
|
|
(
|
|
"updated_by",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="+",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"db_table": "configs_value",
|
|
"indexes": [models.Index(fields=["tenant_id", "key"], name="configs_val_tenant__f38493_idx")],
|
|
"constraints": [
|
|
models.UniqueConstraint(fields=("tenant", "key"), name="uniq_config_key_per_tenant"),
|
|
models.UniqueConstraint(
|
|
condition=models.Q(("tenant__isnull", True)), fields=("key",), name="uniq_global_config_key"
|
|
),
|
|
],
|
|
},
|
|
),
|
|
]
|