Skip to content

Commit

Permalink
Merge pull request #174 from lvalics/lvalics-pdf
Browse files Browse the repository at this point in the history
PDF upload, require a table change.
  • Loading branch information
codebanesr committed Oct 20, 2023
2 parents 8ff2eab + 4faf01e commit 3e9f5c4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.3 on 2023-10-20 16:59

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('web', '0001_initial'),
]

operations = [
migrations.RemoveField(
model_name='pdfdatasource',
name='chatbot_id',
),
migrations.AddField(
model_name='pdfdatasource',
name='chatbot',
field=models.ForeignKey(db_column='chatbot_id', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pdf_data_sources', to='web.chatbot'),
),
]
18 changes: 18 additions & 0 deletions dj_backend_server/web/migrations/0003_alter_pdfdatasource_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.3 on 2023-10-20 19:34

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('web', '0002_remove_pdfdatasource_chatbot_id_and_more'),
]

operations = [
migrations.AlterField(
model_name='pdfdatasource',
name='id',
field=models.AutoField(primary_key=True, serialize=False),
),
]
7 changes: 4 additions & 3 deletions dj_backend_server/web/models/pdf_data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import uuid

class PdfDataSource(models.Model):
id = models.CharField(max_length=36, primary_key=True)
#chatbot = models.ForeignKey(Chatbot, related_name='pdf_data_sources', db_column='chatbot_id', on_delete=models.SET_NULL, null=True)
chatbot_id = models.CharField(max_length=36, null=True)
#id = models.CharField(max_length=36, primary_key=True)
id = models.AutoField(primary_key=True)
chatbot = models.ForeignKey(Chatbot, related_name='pdf_data_sources', db_column='chatbot_id', on_delete=models.SET_NULL, null=True)
#chatbot_id = models.CharField(max_length=36, null=True)
files = models.JSONField()
folder_name = models.CharField(max_length=255, null=True)
created_at = models.DateTimeField(auto_now_add=True, null=True)
Expand Down

0 comments on commit 3e9f5c4

Please sign in to comment.