Skip to content

feat: implement skipping migrations if no new migration files#127

Merged
lethanhdat762003 merged 2 commits into
devfrom
feat/migrate-smart
Jun 17, 2026
Merged

feat: implement skipping migrations if no new migration files#127
lethanhdat762003 merged 2 commits into
devfrom
feat/migrate-smart

Conversation

@lethanhdat762003

Copy link
Copy Markdown
Member

What?

  • Skipping migrations when no new migration files found

Why?

  • To optimize development productivity

How?

  • By adding a new table in public schema. And from that, detect if there's any new migrations files. If yes, run the migrations. Else, skipping migration phase.
Metric Before After
Migrations run per day 50 tenants × 5 restarts = 250 migration scans 5 restarts × 1 hash check = 5 hash checks (+ 50 on the 1 day a migration ships)
Time wasted per day 250 × 0.6s = 150s 5 × 0.01s = 0.05s
DB queries per day 250 × (1 + tenants) = 12,750 ~10

Testing?

  • Functional Testing
  • Security
  • Performance
  • Error Handling
  • Code Quality
  • Documentation
  • Database
  • Deployment
  • Final Review

Anything Else?

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Docker entrypoint to use a custom 'migrate_smart' command instead of standard Django migrations, and adds the 'common' package to INSTALLED_APPS in settings.py. However, adding the parent 'common' package directly alongside its sub-packages is discouraged in Django as it can lead to app label conflicts and double model registration. It is recommended to register only a specific sub-app containing the migration command instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread auth_service/settings.py Outdated
@lethanhdat762003
lethanhdat762003 merged commit 36da7d3 into dev Jun 17, 2026
1 check passed
@ngovinh2k2
ngovinh2k2 deleted the feat/migrate-smart branch July 3, 2026 08:04
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