mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
feat: account deletion; auto incremental uids; display name renaming UI + account deletion UI; enhanced username validation
This commit is contained in:
@@ -111,6 +111,19 @@ namespace SharpbinV3.Server
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
db.Database.Migrate();
|
||||
|
||||
// this is temporary since the migration doesnt seem to work properly
|
||||
db.Database.ExecuteSql($"""
|
||||
CREATE TRIGGER IF NOT EXISTS Users_UID_AutoIncrement
|
||||
AFTER INSERT ON Users
|
||||
BEGIN
|
||||
UPDATE Users
|
||||
SET UID = (
|
||||
SELECT IFNULL(MAX(UID), 0) + 1 FROM Users
|
||||
)
|
||||
WHERE rowid = NEW.rowid AND NEW.UID IS NULL;
|
||||
END;
|
||||
""");
|
||||
}
|
||||
|
||||
app.MapHealthChecks("/health");
|
||||
|
||||
Reference in New Issue
Block a user