Skip to content

feat: Add migration to correct last_status_change for expired users#1187

Merged
ImMohammad20000 merged 2 commits intoGozargah:devfrom
alirezaja1384:users-autodelete-last-status-change-fix
Dec 1, 2024
Merged

feat: Add migration to correct last_status_change for expired users#1187
ImMohammad20000 merged 2 commits intoGozargah:devfrom
alirezaja1384:users-autodelete-last-status-change-fix

Conversation

@alirezaja1384
Copy link
Contributor

@alirezaja1384 alirezaja1384 commented Jul 25, 2024

P.S. I don't know if handling only MySQL and SQLite is enough or not.

alirezaja1384 referenced this pull request Jul 25, 2024
TODO:
 - Send notifications
Copy link
Contributor

@erfjab erfjab left a comment

Choose a reason for hiding this comment

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

Friends also use Mariadb, but the Mariadb and MySQL commands are similar.

@SaintShit
Copy link
Contributor

SaintShit commented Jul 31, 2024

Hi, would you please explain what problem it solves?

@alirezaja1384
Copy link
Contributor Author

alirezaja1384 commented Jul 31, 2024

Hi, would you please explain what problem it solves?

Sure, the migration I wrote before sets that last_status_change to migration time, so if we suppose the expired should be deleted in 30 days, they will be deleted a month after the migration, not their expiration date. This migration sets the last_status_change to the user's expiration time. More.

@ImMohammad20000
Copy link
Contributor

what if user expire is null??

@ImMohammad20000
Copy link
Contributor

what if user expire is null??

@alirezaja1384

@ImMohammad20000 ImMohammad20000 merged commit 8346ce4 into Gozargah:dev Dec 1, 2024
M03ED pushed a commit that referenced this pull request Apr 29, 2025
…1187)

* feat: Add migration to correct last_status_change for expired users.

* add check expire not NULL

---------

Co-authored-by: Mohammad <[email protected]>
naymintun800 pushed a commit to naymintun800/Marzban that referenced this pull request Jul 24, 2025
…ozargah#1187)

* feat: Add migration to correct last_status_change for expired users.

* add check expire not NULL

---------

Co-authored-by: Mohammad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants