Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 29 minutes and 59 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8f4a9626c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ($this->resolveDriver() === 'sqlite') { | ||
| $this->schemaComparator = new SqliteSchemaComparator( | ||
| $this->getAdapter(), | ||
| $this->resolveIgnoreTables(), | ||
| ); |
There was a problem hiding this comment.
Return a SchemaComparator-compatible SQLite comparator
When DB_DRIVER=sqlite, this branch assigns new SqliteSchemaComparator(...) into $this->schemaComparator, but the property and method are both typed as SchemaComparator; because SqliteSchemaComparator does not extend SchemaComparator, PHP will throw a TypeError as soon as this path is hit, so schema comparison/sync is broken for SQLite environments.
Useful? React with 👍 / 👎.
| if ($isSqlite) { | ||
| // SQLite: indexes are created separately, not inline in CREATE TABLE | ||
| // We'll handle them after table creation | ||
| } else { |
There was a problem hiding this comment.
Emit index DDL for new SQLite tables
In SQLite mode this block intentionally skips inline index creation, but no compensating ADD INDEX/CREATE INDEX operations are generated for brand-new tables (the comparator only adds createTable for missing tables), so declared unique/non-unique indexes are silently omitted on initial table creation, which can break uniqueness guarantees and index-dependent query performance.
Useful? React with 👍 / 👎.
| $expectedType = $code->type->canonicalName($code->length, $code->precision, $code->scale); | ||
| $dbTypeNormalized = $this->normalizeDbType($db->columnType); | ||
|
|
||
| if ($this->normalizeType($expectedType) !== $dbTypeNormalized) { |
There was a problem hiding this comment.
Compare SQLite columns using compatible type normalization
This comparator derives $expectedType directly from $code->type->canonicalName(...), but model columns are still declared as MySqlType (via #[Column]), so values like int/varchar(255) are compared against SQLite-normalized integer/text, causing persistent false-positive type diffs and repeated alter operations for unchanged schemas.
Useful? React with 👍 / 👎.
| $constraintName = "fk_{$tableName}_{$fk['from']}_{$fk['id']}"; | ||
| $fks[$constraintName] = [ |
There was a problem hiding this comment.
Key SQLite foreign keys with the canonical constraint name
Here DB foreign keys are keyed as fk_{table}_{column}_{id}, but code-side keys come from ForeignKeyDefinition::constraintName() (fk_{table}_{column}), so compareForeignKeys will never match existing constraints and will keep scheduling add/drop FK changes every run, making FK diffing unreliable.
Useful? React with 👍 / 👎.
Summary
developtargetingmaster1commit(s) ahead,12changed file(s)Changes
Checks
What to Review
src/Adaptersrc/OrmManager.phpsrc/Querysrc/Schemasrc/Syncsrc/TransactionWhat to Verify