Skip to content

Adding questionnaire model#7396

Open
galvana wants to merge 1 commit intomainfrom
ENG-2354-questionnaire-models-and-repository
Open

Adding questionnaire model#7396
galvana wants to merge 1 commit intomainfrom
ENG-2354-questionnaire-models-and-repository

Conversation

@galvana
Copy link
Contributor

@galvana galvana commented Feb 14, 2026

Ticket []

Description Of Changes

Code Changes

Steps to Confirm

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@galvana galvana requested a review from a team as a code owner February 14, 2026 08:17
@galvana galvana requested review from vcruces and removed request for a team February 14, 2026 08:17
@vercel
Copy link
Contributor

vercel bot commented Feb 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Feb 14, 2026 8:17am
fides-privacy-center Ignored Ignored Feb 14, 2026 8:17am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 14, 2026

Greptile Overview

Greptile Summary

Adds database schema for SME questionnaire sessions that link to privacy assessments. The implementation includes:

  • New questionnaire table to track interactive questionnaire sessions with status, progress tracking, reminder functionality, and provider context stored as JSONB
  • New chat_message table for per-message conversation history with sender information to support multiple SMEs
  • One-to-one relationship between PrivacyAssessment and Questionnaire with proper CASCADE deletes
  • Proper indexes on foreign keys and status fields for query performance
  • Complete downgrade migration that properly drops tables and enum type

The schema follows most project conventions including singular table names and proper relationship configurations.

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk after fixing the boolean format issue
  • The implementation is solid with proper database schema design, relationships, and downgrade logic. One syntax issue with boolean server_default format needs correction before merge. No tests included but this is schema-only change that adds foundational models for future functionality.
  • Fix boolean server_default format in migration file (line 95)

Important Files Changed

Filename Overview
src/fides/api/alembic/migrations/versions/xx_2026_02_13_1600_5b2fbaaa7d6d_add_questionnaire_schema.py Creates questionnaire and chat_message tables with proper indexes, foreign keys, and downgrade logic. Migration follows conventions and includes appropriate CASCADE deletes.
src/fides/api/models/questionnaire.py Defines Questionnaire and ChatMessage models with proper relationships and enum status. Uses singular table names per convention.

Last reviewed commit: de7e78c

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

sa.Column("sender_email", sa.String(), nullable=True),
sa.Column("sender_display_name", sa.String(), nullable=True),
sa.Column("text", sa.Text(), nullable=False),
sa.Column("is_bot_message", sa.Boolean(), nullable=False, server_default="false"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses incorrect boolean format. Use server_default="f" instead of server_default="false" per project conventions

Suggested change
sa.Column("is_bot_message", sa.Boolean(), nullable=False, server_default="false"),
sa.Column("is_bot_message", sa.Boolean(), nullable=False, server_default="f"),

Context Used: Rule from dashboard - Use server_default="f" for boolean columns in Alembic migrations instead of default=False or oth... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant