Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Resolve inconsistency in APIToken dialog_id field definition #5749

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

zanyatta
Copy link
Contributor

@zanyatta zanyatta commented Mar 7, 2025

The dialog_id field was inconsistently defined:

  • In the migrate_db() function, it was set to null=True.
  • In the model class, it was defined as null=False.

This inconsistency caused an issue during the initial deployment where the database table did not allow dialog_id to be null. As a result, calling APITokenService.save(**obj) in system_app.py raised the following error:

peewee.IntegrityError: null value in column "dialog_id" violates not-null constraint

What problem does this PR solve?

Error: peewee.IntegrityError: null value in column "dialog_id" violates not-null constraint

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

The `dialog_id` field was inconsistently defined:
- In the `migrate_db()` function, it was set to `null=True`.
- In the model class, it was defined as `null=False`.

This inconsistency caused an issue during the initial deployment where the database table did not allow `dialog_id` to be null. As a result, calling `APITokenService.save(**obj)` in `system_app.py` raised the following error:

```
peewee.IntegrityError: null value in column "dialog_id" violates not-null constraint
```
@KevinHuSh KevinHuSh added the ci Continue Integration label Mar 7, 2025
@KevinHuSh KevinHuSh merged commit 0e3e129 into infiniflow:main Mar 7, 2025
3 checks passed
TeslaZY pushed a commit to TeslaZY/ragflow that referenced this pull request Mar 8, 2025
…finiflow#5749)

The `dialog_id` field was inconsistently defined:
- In the `migrate_db()` function, it was set to `null=True`.
- In the model class, it was defined as `null=False`.

This inconsistency caused an issue during the initial deployment where
the database table did not allow `dialog_id` to be null. As a result,
calling `APITokenService.save(**obj)` in `system_app.py` raised the
following error:

```
peewee.IntegrityError: null value in column "dialog_id" violates not-null constraint
```

### What problem does this PR solve?

Error: peewee.IntegrityError: null value in column "dialog_id" violates
not-null constraint

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
@zanyatta zanyatta deleted the patch-1 branch March 11, 2025 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continue Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants