text: ﻿CREATE TABLE [identity].[UserRoles](
  	[UserId] [uniqueidentifier] NOT NULL,
  	[RoleId] [uniqueidentifier] NOT NULL,
      CONSTRAINT [PK_UserRoles] PRIMARY KEY CLUSTERED ([UserId] ASC, [RoleId] ASC)
  WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  
  GO
  
  ALTER TABLE [identity].[UserRoles]  WITH CHECK ADD  CONSTRAINT [FK_UserRoles_Roles_RoleId] FOREIGN KEY([RoleId])
  REFERENCES [identity].[Roles] ([Id])
  ON DELETE CASCADE
  
  GO
  
  ALTER TABLE [identity].[UserRoles] CHECK CONSTRAINT [FK_UserRoles_Roles_RoleId]
  
  GO
  
  ALTER TABLE [identity].[UserRoles]  WITH CHECK ADD  CONSTRAINT [FK_UserRoles_Users_UserId] FOREIGN KEY([UserId])
  REFERENCES [identity].[Users] ([Id])
  ON DELETE CASCADE
  
  GO
  
  ALTER TABLE [identity].[UserRoles] CHECK CONSTRAINT [FK_UserRoles_Users_UserId]
  
  GO
  
  CREATE NONCLUSTERED INDEX [IX_UserRoles_RoleId] ON [identity].[UserRoles] ([RoleId] ASC)
  WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]