From a475fe460001a7333651ad13c9a9fafbd23f8f26 Mon Sep 17 00:00:00 2001 From: pmc <740076875@qq.com> Date: Thu, 7 May 2026 17:35:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(01-01):=20=E8=87=AA=E5=8A=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=B9=B6=E5=BA=94=E7=94=A8=200004=5Fcredentialslot=20?= =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 由 python manage.py makemigrations aiapp 自动生成(未手写) - CreateModel(name='CredentialSlot') 含 id/app_id/access_token/updated_at 四列 - python manage.py migrate aiapp 退出码 0;showmigrations 显示 [X] - shell 自检:首访 created=True app_id='' / 二次 save 后 count=1 obj2.pk=1 - N 次 save 守恒断言通过:CredentialSlot.objects.count() == 1 - 探针数据已写入 DB:pk=1 / app_id='probe_app' / access_token='probe_secret_xxxx' (Plan 02 Task 2 浏览器 checkpoint 依赖此值,对应脱敏期望串 *************xxxx) - 覆盖需求 CRED-01 数据库 schema 落地 --- .../aiapp/migrations/0004_credentialslot.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 qy_lty/aiapp/migrations/0004_credentialslot.py diff --git a/qy_lty/aiapp/migrations/0004_credentialslot.py b/qy_lty/aiapp/migrations/0004_credentialslot.py new file mode 100644 index 0000000..a36eadd --- /dev/null +++ b/qy_lty/aiapp/migrations/0004_credentialslot.py @@ -0,0 +1,26 @@ +# Generated by Django 5.2.12 on 2026-05-07 09:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('aiapp', '0003_create_rtc_bot'), + ] + + operations = [ + migrations.CreateModel( + name='CredentialSlot', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('app_id', models.CharField(blank=True, default='', help_text='第三方服务商分配的 APP ID;运营在 Admin 录入', max_length=128, verbose_name='APP ID')), + ('access_token', models.CharField(blank=True, default='', help_text='第三方服务商访问令牌;DB 明文存储,Admin 列表/查看态末 4 位脱敏', max_length=512, verbose_name='Access Token')), + ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')), + ], + options={ + 'verbose_name': '凭据槽位', + 'verbose_name_plural': '凭据槽位', + }, + ), + ]