Skip to content

feat (user counert): add active_sessions table for counter#152

Merged
ViktorSvertoka merged 1 commit into
developfrom
yn/db/counter-migration
Jan 17, 2026
Merged

feat (user counert): add active_sessions table for counter#152
ViktorSvertoka merged 1 commit into
developfrom
yn/db/counter-migration

Conversation

@YNazymko12

@YNazymko12 YNazymko12 commented Jan 17, 2026

Copy link
Copy Markdown
Collaborator
  • Add active_sessions schema with session tracking
  • Add index on last_activity for performance optimization
  • Prepare database structure for live online user counter

Table structure:

  • session_id (text, PK): unique session identifier
  • last_activity (timestamp): tracks user's last activity time

Migration file: drizzle/0002_clean_martin_li.sql

Related to: (SP: 3) [Frontend + Backend] Track all active users and display live online counter on Home page

Summary by CodeRabbit

Release Notes

  • New Features
    • Implemented active session tracking to monitor and manage user session activity, enhancing system reliability and session handling capabilities.

✏️ Tip: You can customize this high-level summary in your review settings.

- Add active_sessions schema with session tracking
- Add index on last_activity for performance optimization
- Prepare database structure for live online user counter

Table structure:
- session_id (text, PK): unique session identifier
- last_activity (timestamp): tracks user's last activity time

Migration file: drizzle/0002_clean_martin_li.sql

Related to: (SP: 3) [Frontend + Backend] Track all active users and display live online counter on Home page
@netlify

netlify Bot commented Jan 17, 2026

Copy link
Copy Markdown

Deploy Preview for develop-devlovers ready!

Name Link
🔨 Latest commit 0de414d
🔍 Latest deploy log https://app.netlify.com/projects/develop-devlovers/deploys/696bb227e6dee800085cfc6d
😎 Deploy Preview https://deploy-preview-152--develop-devlovers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

These changes introduce a new active_sessions database table to the frontend schema using drizzle-orm. The changes include TypeScript schema definitions, SQL migration, schema metadata snapshot, and journal entry.

Changes

Cohort / File(s) Summary
Schema Definitions
frontend/db/schema/index.ts, frontend/db/schema/sessions.ts
Added new sessions schema module with export. New sessions.ts defines activeSessions table with sessionId (primary key) and lastActivity (timestamp, defaults to now). Updated index export to include sessions and changed quote style.
Database Migration
frontend/drizzle/0002_clean_martin_li.sql
SQL migration creating active_sessions table with session_id (text, primary key) and last_activity (timestamp, not null, default now()). Includes B-tree index on last_activity.
Migration Metadata
frontend/drizzle/meta/0002_snapshot.json, frontend/drizzle/meta/_journal.json
Added comprehensive schema snapshot capturing full database model structure. Journal entry records migration metadata with tag "0002_clean_martin_li" and timestamp.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • ViktorSvertoka
  • AM1007

Poem

A sessions table, fresh and new,
With timestamps tracking what we do,
From schema file to SQL's embrace,
The database finds its proper place. 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions 'user counert' (apparent typo for 'counter') and references adding active_sessions table, which aligns with the PR's main objective of adding a sessions table for a live user counter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ViktorSvertoka ViktorSvertoka merged commit de119ea into develop Jan 17, 2026
9 checks passed
@ViktorSvertoka ViktorSvertoka deleted the yn/db/counter-migration branch January 17, 2026 16:39
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