Download apps/cases/migrations/0003_initial.py from jun2024/fc: direct link, hf CLI and curl.
- Browser
- Download file 10.4 kB
-
https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/cases/migrations/0003_initial.py
- Command line
-
hf download hf://spaces/jun2024/fc/apps/cases/migrations/0003_initial.py
-
curl -L -o 0003_initial.py https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/cases/migrations/0003_initial.py
10.4 kB
| # Generated by Django 6.0.2 on 2026-02-28 06:41 | |
| import django.db.models.deletion | |
| from django.db import migrations, models | |
| class Migration(migrations.Migration): | |
| initial = True | |
| dependencies = [ | |
| ("cases", "0002_initial"), | |
| ("documents", "0001_initial"), | |
| ] | |
| operations = [ | |
| migrations.AddField( | |
| model_name="casetemplatebinding", | |
| name="template", | |
| field=models.ForeignKey( | |
| on_delete=django.db.models.deletion.CASCADE, | |
| related_name="case_bindings", | |
| to="documents.documenttemplate", | |
| verbose_name="文书模板", | |
| ), | |
| ), | |
| migrations.AddField( | |
| model_name="chatauditlog", | |
| name="case", | |
| field=models.ForeignKey( | |
| blank=True, | |
| help_text="关联的案件", | |
| null=True, | |
| on_delete=django.db.models.deletion.CASCADE, | |
| related_name="chat_audit_logs", | |
| to="cases.case", | |
| verbose_name="关联案件", | |
| ), | |
| ), | |
| migrations.AddField( | |
| model_name="chatauditlog", | |
| name="chat", | |
| field=models.ForeignKey( | |
| blank=True, | |
| help_text="关联的群聊,某些操作(如配置错误)可能没有关联群聊", | |
| null=True, | |
| on_delete=django.db.models.deletion.CASCADE, | |
| related_name="audit_logs", | |
| to="cases.casechat", | |
| verbose_name="关联群聊", | |
| ), | |
| ), | |
| migrations.AddField( | |
| model_name="supervisingauthority", | |
| name="case", | |
| field=models.ForeignKey( | |
| on_delete=django.db.models.deletion.CASCADE, | |
| related_name="supervising_authorities", | |
| to="cases.case", | |
| verbose_name="案件", | |
| ), | |
| ), | |
| migrations.AddField( | |
| model_name="casematerialgrouporder", | |
| name="supervising_authority", | |
| field=models.ForeignKey( | |
| blank=True, | |
| null=True, | |
| on_delete=django.db.models.deletion.CASCADE, | |
| related_name="material_group_orders", | |
| to="cases.supervisingauthority", | |
| verbose_name="主管机关", | |
| ), | |
| ), | |
| migrations.AddField( | |
| model_name="casematerial", | |
| name="supervising_authority", | |
| field=models.ForeignKey( | |
| blank=True, | |
| null=True, | |
| on_delete=django.db.models.deletion.PROTECT, | |
| related_name="materials", | |
| to="cases.supervisingauthority", | |
| verbose_name="主管机关", | |
| ), | |
| ), | |
| migrations.AddIndex( | |
| model_name="case", | |
| index=models.Index(fields=["contract"], name="cases_case_contrac_5f10b0_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="case", | |
| index=models.Index(fields=["is_archived"], name="cases_case_is_arch_591fe0_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="case", | |
| index=models.Index(fields=["filing_number"], name="cases_case_filing__2ecc17_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="case", | |
| index=models.Index(fields=["start_date"], name="cases_case_start_d_a2435c_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="case", | |
| index=models.Index(fields=["current_stage"], name="cases_case_current_1f80b8_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="case", | |
| index=models.Index(fields=["-start_date"], name="cases_case_start_d_495660_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casechat", | |
| index=models.Index(fields=["case", "platform"], name="cases_casec_case_id_bc52c8_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casechat", | |
| index=models.Index(fields=["chat_id"], name="cases_casec_chat_id_d8fb11_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casechat", | |
| index=models.Index(fields=["is_active"], name="cases_casec_is_acti_b70a82_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casechat", | |
| index=models.Index(fields=["owner_id"], name="cases_casec_owner_i_14d2b1_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casechat", | |
| index=models.Index(fields=["owner_verified"], name="cases_casec_owner_v_5bd906_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casechat", | |
| index=models.Index(fields=["owner_verified_at"], name="cases_casec_owner_v_bb6dfd_idx"), | |
| ), | |
| migrations.AlterUniqueTogether( | |
| name="casechat", | |
| unique_together={("case", "platform", "chat_id")}, | |
| ), | |
| migrations.AddIndex( | |
| model_name="casefolderbinding", | |
| index=models.Index(fields=["case"], name="cases_casef_case_id_30addd_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casefolderbinding", | |
| index=models.Index(fields=["created_at"], name="cases_casef_created_98b4c8_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="caselog", | |
| index=models.Index(fields=["case", "-created_at"], name="cases_casel_case_id_81df24_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="caselog", | |
| index=models.Index(fields=["actor"], name="cases_casel_actor_i_b1e312_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerialtype", | |
| index=models.Index(fields=["category", "name"], name="cases_casem_categor_8f8db8_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerialtype", | |
| index=models.Index(fields=["law_firm", "category"], name="cases_casem_law_fir_2bfd05_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerialtype", | |
| index=models.Index(fields=["is_active"], name="cases_casem_is_acti_760b66_idx"), | |
| ), | |
| migrations.AddConstraint( | |
| model_name="casematerialtype", | |
| constraint=models.UniqueConstraint( | |
| fields=("law_firm", "category", "name"), name="uniq_case_material_type_scope" | |
| ), | |
| ), | |
| migrations.AlterUniqueTogether( | |
| name="caseparty", | |
| unique_together={("case", "client")}, | |
| ), | |
| migrations.AddIndex( | |
| model_name="casetemplatebinding", | |
| index=models.Index(fields=["case", "binding_source"], name="cases_caset_case_id_39590f_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casetemplatebinding", | |
| index=models.Index(fields=["template"], name="cases_caset_templat_8dfc20_idx"), | |
| ), | |
| migrations.AlterUniqueTogether( | |
| name="casetemplatebinding", | |
| unique_together={("case", "template")}, | |
| ), | |
| migrations.AddIndex( | |
| model_name="chatauditlog", | |
| index=models.Index(fields=["chat", "-timestamp"], name="cases_chata_chat_id_6f408c_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="chatauditlog", | |
| index=models.Index(fields=["case", "-timestamp"], name="cases_chata_case_id_6351d9_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="chatauditlog", | |
| index=models.Index(fields=["action", "-timestamp"], name="cases_chata_action_cd1c27_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="chatauditlog", | |
| index=models.Index(fields=["success", "-timestamp"], name="cases_chata_success_b9fb12_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="chatauditlog", | |
| index=models.Index(fields=["external_chat_id", "-timestamp"], name="cases_chata_externa_1e6bb7_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="chatauditlog", | |
| index=models.Index(fields=["platform", "-timestamp"], name="cases_chata_platfor_4346c4_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="chatauditlog", | |
| index=models.Index(fields=["-timestamp"], name="cases_chata_timesta_4973a8_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="supervisingauthority", | |
| index=models.Index(fields=["case"], name="cases_super_case_id_69b131_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="supervisingauthority", | |
| index=models.Index(fields=["authority_type"], name="cases_super_authori_710bc8_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerialgrouporder", | |
| index=models.Index( | |
| fields=["case", "category", "side", "sort_index"], name="cases_casem_case_id_a1cffb_idx" | |
| ), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerialgrouporder", | |
| index=models.Index( | |
| fields=["case", "category", "supervising_authority", "sort_index"], | |
| name="cases_casem_case_id_62c8f7_idx", | |
| ), | |
| ), | |
| migrations.AddConstraint( | |
| model_name="casematerialgrouporder", | |
| constraint=models.UniqueConstraint( | |
| fields=("case", "category", "side", "supervising_authority", "type"), | |
| name="uniq_case_material_group_order", | |
| ), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerial", | |
| index=models.Index(fields=["case", "category", "created_at"], name="cases_casem_case_id_746cf1_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerial", | |
| index=models.Index(fields=["case", "category", "side"], name="cases_casem_case_id_865002_idx"), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerial", | |
| index=models.Index( | |
| fields=["case", "category", "supervising_authority"], name="cases_casem_case_id_928a97_idx" | |
| ), | |
| ), | |
| migrations.AddIndex( | |
| model_name="casematerial", | |
| index=models.Index(fields=["type_name"], name="cases_casem_type_na_5a349e_idx"), | |
| ), | |
| ] | |