Skip to content

fix: sql schema - #3262

Merged
DevWithPranav merged 2 commits into
dev-serverfrom
dev
Oct 9, 2026
Merged

DevWithPranav merged 2 commits into
dev-serverfrom
dev

Conversation

@DevWithPranav

Copy link
Copy Markdown
Collaborator

No description provided.

@DevWithPranav
DevWithPranav merged commit 14f74b7 into dev-server Oct 9, 2026
2 checks passed
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Critical impact] Database schema change without visible migration path.

Fix the inconsistent table collations before merging so fresh schema imports work independently of database defaults.

Findings

  1. P1 Database defaults can break imports ▶
  2. P2 Long descriptions cannot save ▶

Summary

Replaces schema.sql with a reconstructed schema combining production definitions, development additions, and company problem statements.

  • Developers can use one schema file for the base, development changes, and company problem statements.

Reviews (1) · Last reviewed commit: "Merge pull request #3261 from DevWithPra..." · Reviewed by Greptile

Comment thread schema.sql
suspended_by VARCHAR(36),
CONSTRAINT fk_user_ref_deleted_by FOREIGN KEY (deleted_by) REFERENCES user (id) ON DELETE CASCADE,
CONSTRAINT fk_user_ref_suspended_by FOREIGN KEY (suspended_by) REFERENCES user (id) ON DELETE CASCADE
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Database defaults can break imports

If the target MySQL 8 database uses utf8mb4_unicode_ci, for example, user now inherits that collation while events explicitly uses utf8mb4_0900_ai_ci. MySQL rejects the foreign key from events.created_by to user.id because their collations differ, stopping the import. The previous definitions explicitly used matching collations. Keep consistent, explicit table options throughout Parts A and B so imports do not depend on database defaults.

Comment thread schema.sql

ALTER TABLE `notification` ADD COLUMN `is_read` bool DEFAULT b'0' NOT NULL;

ALTER TABLE `notificat

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Long descriptions cannot save

problem_statement.description uses TEXT, but ProblemStatementWriteSerializer accepts 20,000 characters. With utf8mb4, 20,000 four-byte characters need 80,000 bytes, exceeding the 65,535-byte limit of TEXT. The request passes validation but fails when saved. Use LONGTEXT, as this reconstruction already does for other Django text fields.

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

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

2 participants