forked from 1Panel-dev/MaxKB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001_initial.py
35 lines (29 loc) · 1.69 KB
/
0001_initial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Generated by Django 4.1.10 on 2024-03-18 17:48
import common.field.vector_field
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('dataset', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Embedding',
fields=[
('id', models.CharField(max_length=128, primary_key=True, serialize=False, verbose_name='主键id')),
('source_id', models.CharField(max_length=128, verbose_name='资源id')),
('source_type', models.CharField(choices=[('0', '问题'), ('1', '段落'), ('2', '标题')], default='0', max_length=5, verbose_name='资源类型')),
('is_active', models.BooleanField(default=True, max_length=1, verbose_name='是否可用')),
('embedding', common.field.vector_field.VectorField(verbose_name='向量')),
('meta', models.JSONField(default=dict, verbose_name='元数据')),
('dataset', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='dataset.dataset', verbose_name='文档关联')),
('document', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='dataset.document', verbose_name='文档关联')),
('paragraph', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='dataset.paragraph', verbose_name='段落关联')),
],
options={
'db_table': 'embedding',
'unique_together': {('source_id', 'source_type')},
},
),
]