Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Verified Commit 62cc3702 authored by Vincent SIMONIN's avatar Vincent SIMONIN
Browse files

Made migration great again

parent c3ad1631
No related branches found
No related tags found
1 merge request!37Make alt_name an array of string
Pipeline #91224 passed
......@@ -19,8 +19,8 @@ class Migration(migrations.Migration):
field=ArrayField(models.CharField(max_length=256), blank=True, null=True),
),
migrations.RunSQL(
sql="UPDATE netbox_cert_plugin_certificate AS t set new_alt_name=ARRAY[t.alt_name]",
reverse_sql="UPDATE netbox_cert_plugin_certificate AS t set new_alt_name=NULL",
sql="UPDATE netbox_cert_plugin_certificate AS t set new_alt_name=string_to_array(t.alt_name, ',')",
reverse_sql="UPDATE netbox_cert_plugin_certificate AS t set alt_name=array_to_string(new_alt_name, ',')",
),
migrations.RemoveField(model_name="Certificate", name="alt_name"),
migrations.RenameField(model_name="Certificate", new_name="alt_name", old_name="new_alt_name")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment