fix: restore tubco user onboarding access
Some checks failed
CI / python-validation (push) Has been cancelled
CI / docker-release-gate (push) Has been cancelled
i18n / compile-translations (push) Has been cancelled

This commit is contained in:
Md Bayazid Bostame
2026-04-08 13:38:30 +02:00
parent 0a38e04606
commit b60d9eaeb7
4 changed files with 87 additions and 1 deletions

View File

@@ -0,0 +1,62 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workflows', '0058_alter_formsectionconfig_options_and_more'),
]
operations = [
migrations.SeparateDatabaseAndState(
database_operations=[
migrations.RunSQL(
sql=(
"ALTER TABLE workflows_userprofile "
"ADD COLUMN IF NOT EXISTS temporary_role_key varchar(64) NOT NULL DEFAULT '';"
),
reverse_sql=(
"ALTER TABLE workflows_userprofile "
"DROP COLUMN IF EXISTS temporary_role_key;"
),
),
migrations.RunSQL(
sql=(
"ALTER TABLE workflows_userprofile "
"ADD COLUMN IF NOT EXISTS temporary_role_expires_at timestamptz NULL;"
),
reverse_sql=(
"ALTER TABLE workflows_userprofile "
"DROP COLUMN IF EXISTS temporary_role_expires_at;"
),
),
migrations.RunSQL(
sql=(
"ALTER TABLE workflows_userprofile "
"ADD COLUMN IF NOT EXISTS temporary_role_reason text NOT NULL DEFAULT '';"
),
reverse_sql=(
"ALTER TABLE workflows_userprofile "
"DROP COLUMN IF EXISTS temporary_role_reason;"
),
),
],
state_operations=[
migrations.AddField(
model_name='userprofile',
name='temporary_role_key',
field=models.CharField(blank=True, default='', max_length=64),
),
migrations.AddField(
model_name='userprofile',
name='temporary_role_expires_at',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name='userprofile',
name='temporary_role_reason',
field=models.TextField(blank=True, default=''),
),
],
),
]