Skip to content

added missing migrations in mysql prisma #1683

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

pauloboc
Copy link

@pauloboc pauloboc commented Jul 3, 2025

Summary by Sourcery

Add missing Prisma MySQL migrations for new integrations (N8n, Evoai, and Nats), extend the Typebot schema, and adjust Media and IsOnWhatsapp tables

New Features:

  • Create N8n and N8nSetting tables with indexes and foreign keys
  • Create Evoai and EvoaiSetting tables with indexes and foreign keys
  • Create Nats table with events JSON, unique index, and foreign key

Enhancements:

  • Add splitMessages and timePerChar columns to Typebot and TypebotSetting tables

Chores:

  • Drop unique index on Media.fileName
  • Add lid column to IsOnWhatsapp table

Copy link
Contributor

sourcery-ai bot commented Jul 3, 2025

Reviewer's Guide

Introduces new MySQL migrations for N8n, Evoai, and Nats integrations, schema updates for Typebot entities, removal of a Media index, and addition of a new column to IsOnWhatsapp.

Class diagram for new and updated database entities

classDiagram
  class N8n {
    +String id
    +Boolean enabled
    +String description
    +String webhookUrl
    +String basicAuthUser
    +String basicAuthPass
    +Int expire
    +String keywordFinish
    +Int delayMessage
    +String unknownMessage
    +Boolean listeningFromMe
    +Boolean stopBotFromMe
    +Boolean keepOpen
    +Int debounceTime
    +Json ignoreJids
    +Boolean splitMessages
    +Int timePerChar
    +Enum triggerType
    +Enum triggerOperator
    +String triggerValue
    +Timestamp createdAt
    +Timestamp updatedAt
    +String instanceId
  }
  class N8nSetting {
    +String id
    +Int expire
    +String keywordFinish
    +Int delayMessage
    +String unknownMessage
    +Boolean listeningFromMe
    +Boolean stopBotFromMe
    +Boolean keepOpen
    +Int debounceTime
    +Json ignoreJids
    +Boolean splitMessages
    +Int timePerChar
    +Timestamp createdAt
    +Timestamp updatedAt
    +String n8nIdFallback
    +String instanceId
  }
  class Evoai {
    +String id
    +Boolean enabled
    +String description
    +String agentUrl
    +String apiKey
    +Int expire
    +String keywordFinish
    +Int delayMessage
    +String unknownMessage
    +Boolean listeningFromMe
    +Boolean stopBotFromMe
    +Boolean keepOpen
    +Int debounceTime
    +Json ignoreJids
    +Boolean splitMessages
    +Int timePerChar
    +Enum triggerType
    +Enum triggerOperator
    +String triggerValue
    +Timestamp createdAt
    +Timestamp updatedAt
    +String instanceId
  }
  class EvoaiSetting {
    +String id
    +Int expire
    +String keywordFinish
    +Int delayMessage
    +String unknownMessage
    +Boolean listeningFromMe
    +Boolean stopBotFromMe
    +Boolean keepOpen
    +Int debounceTime
    +Json ignoreJids
    +Boolean splitMessages
    +Int timePerChar
    +Timestamp createdAt
    +Timestamp updatedAt
    +String evoaiIdFallback
    +String instanceId
  }
  class Nats {
    +String id
    +Boolean enabled
    +Json events
    +Timestamp createdAt
    +Timestamp updatedAt
    +String instanceId
  }
  class Typebot {
    +Boolean splitMessages
    +Int timePerChar
  }
  class TypebotSetting {
    +Boolean splitMessages
    +Int timePerChar
  }
  class Media {
    -- fileName index removed
  }
  class IsOnWhatsapp {
    +String lid
  }
Loading

File-Level Changes

Change Details Files
Add N8n integration tables and constraints
  • Create N8n and N8nSetting tables with default fields
  • Add unique index on N8nSetting.instanceId
  • Add foreign keys for N8n.instanceId and N8nSetting relations
prisma/mysql-migrations/20250514232744_add_n8n_table/migration.sql
Add Evoai integration tables and constraints
  • Create Evoai and EvoaiSetting tables mirroring N8n structure
  • Add unique index on EvoaiSetting.instanceId
  • Add foreign keys for Evoai.instanceId and EvoaiSetting relations
prisma/mysql-migrations/20250515211815_add_evoai_table/migration.sql
Add Nats integration table and constraint
  • Create Nats table with events JSON and default flags
  • Add unique index on Nats.instanceId
  • Add foreign key for Nats.instanceId
prisma/mysql-migrations/20250225180031_add_nats_integration/migration.sql
Extend Typebot schema with messaging fields
  • Alter Typebot to add splitMessages and timePerChar
  • Alter TypebotSetting to add splitMessages and timePerChar
prisma/mysql-migrations/20250612155048_add_coluns_trypebot_tables/migration.sql
Remove unique constraint from Media fileName
  • Drop unique index on Media.fileName
prisma/mysql-migrations/20250516012152_remove_unique_atribute_for_file_name_in_media/migration.sql
Add lid column to IsOnWhatsapp
  • Add new lid VARCHAR column to IsOnWhatsapp
prisma/mysql-migrations/20250613143000_add_lid_column_to_is_onwhatsapp/migration.sql

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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