Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Missing migration added.

Type of Change

  • Bug fix

@icecrasher321 icecrasher321 merged commit c197b04 into staging Dec 8, 2025
3 checks passed
@vercel
Copy link

vercel bot commented Dec 8, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Dec 8, 2025 10:07pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 8, 2025

Greptile Overview

Greptile Summary

This PR restores migration 0118 that was accidentally removed by a git force push. The migration adds billing-related fields to support credit balance tracking and billing blocked status:

  • Creates billing_blocked_reason enum with values payment_failed and dispute
  • Adds credit_balance column (numeric, default 0) to both organization and user_stats tables
  • Adds billing_blocked_reason column to user_stats table

The migration aligns with schema definitions in packages/db/schema.ts and properly chains from migration 0117. All metadata files (snapshot and journal) are correctly updated.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The migration is straightforward and only adds new columns with safe defaults. The SQL syntax is correct, the migration chain is valid (prevId correctly references 0117), and the schema matches the TypeScript definitions. This is a bug fix that restores accidentally deleted migration files.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/db/migrations/0118_tiresome_landau.sql 5/5 adds billing_blocked_reason enum and credit_balance columns to organization and user_stats tables
packages/db/migrations/meta/0118_snapshot.json 5/5 snapshot metadata reflecting the new schema state after migration 0118
packages/db/migrations/meta/_journal.json 5/5 journal entry added for migration 0118_tiresome_landau

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Git as Git Repository
    participant DB as Database Schema
    participant Drizzle as Drizzle ORM
    
    Note over Dev,Git: Migration 0118 accidentally removed by force push
    
    Dev->>Git: Restore migration 0118_tiresome_landau.sql
    Dev->>Git: Restore 0118_snapshot.json
    Dev->>Git: Update _journal.json with migration entry
    
    Note over Git,DB: Migration defines new billing fields
    
    Git->>Drizzle: Migration available for execution
    Drizzle->>DB: CREATE TYPE billing_blocked_reason ENUM
    Drizzle->>DB: ALTER TABLE organization ADD credit_balance
    Drizzle->>DB: ALTER TABLE user_stats ADD credit_balance
    Drizzle->>DB: ALTER TABLE user_stats ADD billing_blocked_reason
    
    DB-->>Drizzle: Schema updated successfully
    Drizzle-->>Dev: Migration ready to deploy
Loading

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.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 deleted the fix/missing-migration branch December 9, 2025 01:00
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.

2 participants