21 lines
599 B
SQL
21 lines
599 B
SQL
-- Nuclear option: Delete ALL users and let seed data recreate them
|
|
-- WARNING: This deletes ALL users including any you've created manually
|
|
-- Run against PowderCoatingDb
|
|
|
|
BEGIN TRANSACTION;
|
|
|
|
PRINT 'Deleting all user-related data...';
|
|
|
|
-- Delete all user-related records
|
|
DELETE FROM AspNetUserClaims;
|
|
DELETE FROM AspNetUserRoles;
|
|
DELETE FROM AspNetUserLogins;
|
|
DELETE FROM AspNetUserTokens;
|
|
DELETE FROM AspNetUsers;
|
|
|
|
PRINT 'All users deleted.';
|
|
PRINT 'User count: ' + CAST((SELECT COUNT(*) FROM AspNetUsers) AS VARCHAR);
|
|
PRINT 'Restart the application to recreate seed users.';
|
|
|
|
COMMIT TRANSACTION;
|