IF OBJECT_ID(N'[dbo].[FK_NB_ChannelGF_TournamentUser]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_TournamentUser] DROP CONSTRAINT [FK_NB_ChannelGF_TournamentUser];
GO

EXEC sp_rename 'GF_TournamentUser.NB_Channel_ChannelID', 'Principal_PrincipalID', 'COLUMN';
GO

-- Creating foreign key on [Principal_PrincipalID] in table 'GF_TournamentUser'
ALTER TABLE [dbo].[GF_TournamentUser]
ADD CONSTRAINT [FK_GF_TournamentUserPrincipal]
    FOREIGN KEY ([Principal_PrincipalID])
    REFERENCES [dbo].[Principal]
        ([PrincipalID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating non-clustered index for FOREIGN KEY 'FK_GF_TournamentUserPrincipal'
CREATE INDEX [IX_FK_GF_TournamentUserPrincipal]
ON [dbo].[GF_TournamentUser]
    ([Principal_PrincipalID]);
GO

