tuitio/IdentityServer.Domain.Data/Scripts/1.0.1/03.Add admin user.sql

13 lines
492 B
MySQL
Raw Normal View History

if not exists (select top 1 1 from AppUser where UserName = '***REMOVED***')
begin
declare @activeStatusId int
select @activeStatusId = StatusId from UserStatus where StatusCode = 'ACTIVE'
insert into AppUser(UserName, [Password], FirstName, CreationDate, SecurityStamp, StatusId)
select '***REMOVED***' as UserName,
'***REMOVED***' as [Password],
***REMOVED*** as FirstName,
getdate() as CreationDate,
cast(newid() as varchar(100)) as SecurityStamp,
@activeStatusId as StatusId
end