IF OBJECT_ID(N'[dbo].[FK_GF_SkillsSkillLevel]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_SkillLevel] DROP CONSTRAINT [FK_GF_SkillsSkillLevel];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_SkillsGF_AssignedSkill]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_AssignedSkill] DROP CONSTRAINT [FK_GF_SkillsGF_AssignedSkill];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_BadgeGF_AssignedBadge]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_AssignedBadge] DROP CONSTRAINT [FK_GF_BadgeGF_AssignedBadge];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_CertificateGF_AssignedCertificate]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_AssignedCertificate] DROP CONSTRAINT [FK_GF_CertificateGF_AssignedCertificate];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_AssignedAchievementGF_AssignedSkill]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_AssignedSkill] DROP CONSTRAINT [FK_GF_AssignedAchievementGF_AssignedSkill];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_AssignedAchievementGF_AssignedCertificate]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_AssignedCertificate] DROP CONSTRAINT [FK_GF_AssignedAchievementGF_AssignedCertificate];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_AssignedAchievementGF_AssignedBadge]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_AssignedBadge] DROP CONSTRAINT [FK_GF_AssignedAchievementGF_AssignedBadge];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_AssignedAchievementGF_Accolade]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Accolade] DROP CONSTRAINT [FK_GF_AssignedAchievementGF_Accolade];
GO
IF OBJECT_ID(N'[dbo].[FK_PrincipalGF_Accolade]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Accolade] DROP CONSTRAINT [FK_PrincipalGF_Accolade];
GO
IF OBJECT_ID(N'[dbo].[FK_PrincipalGF_AssignedAchievement]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_AssignedAchievement] DROP CONSTRAINT [FK_PrincipalGF_AssignedAchievement];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_SkillLevelGF_AssignedSkill]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_AssignedSkill] DROP CONSTRAINT [FK_GF_SkillLevelGF_AssignedSkill];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_QuizGF_Field]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Field] DROP CONSTRAINT [FK_GF_QuizGF_Field];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_FieldGF_Option]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Option] DROP CONSTRAINT [FK_GF_FieldGF_Option];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_ResponseGF_ResponseField]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_ResponseField] DROP CONSTRAINT [FK_GF_ResponseGF_ResponseField];
GO
IF OBJECT_ID(N'[dbo].[FK_PrincipalGF_Response]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Response] DROP CONSTRAINT [FK_PrincipalGF_Response];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentGF_TournamentAdmin]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_TournamentAdmin] DROP CONSTRAINT [FK_GF_TournamentGF_TournamentAdmin];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentGF_TournamentMember]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_TournamentMember] DROP CONSTRAINT [FK_GF_TournamentGF_TournamentMember];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentGF_SpecialBet]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_SpecialBet] DROP CONSTRAINT [FK_GF_TournamentGF_SpecialBet];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_SpecialBetGF_SpecialbetOption]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_SpecialbetOption] DROP CONSTRAINT [FK_GF_SpecialBetGF_SpecialbetOption];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentGF_Game]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Game] DROP CONSTRAINT [FK_GF_TournamentGF_Game];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_ExternalTournamentGF_ExternalTeam]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_ExternalTeam] DROP CONSTRAINT [FK_GF_ExternalTournamentGF_ExternalTeam];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentGF_Placedbet]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Placedbet] DROP CONSTRAINT [FK_GF_TournamentGF_Placedbet];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_PlacedbetGF_PlacedGameBet]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_PlacedGameBet] DROP CONSTRAINT [FK_GF_PlacedbetGF_PlacedGameBet];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_PlacedbetGF_PlacedSpecialbet]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_PlacedSpecialbet] DROP CONSTRAINT [FK_GF_PlacedbetGF_PlacedSpecialbet];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentGF_TournamentUser]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_TournamentUser] DROP CONSTRAINT [FK_GF_TournamentGF_TournamentUser];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_InternalTournamentGF_InteralTeam]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_InteralTeam] DROP CONSTRAINT [FK_GF_InternalTournamentGF_InteralTeam];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_QuizGF_QuizAdmin]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_QuizAdmin] DROP CONSTRAINT [FK_GF_QuizGF_QuizAdmin];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_QuizGF_QuizMembers]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_QuizMembers] DROP CONSTRAINT [FK_GF_QuizGF_QuizMembers];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_QuizGF_QuizAction]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_QuizAction] DROP CONSTRAINT [FK_GF_QuizGF_QuizAction];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_AchievementGF_QuizAction]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_QuizAction] DROP CONSTRAINT [FK_GF_AchievementGF_QuizAction];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentGF_TournamentAction]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_TournamentAction] DROP CONSTRAINT [FK_GF_TournamentGF_TournamentAction];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_AchievementGF_TournamentAction]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_TournamentAction] DROP CONSTRAINT [FK_GF_AchievementGF_TournamentAction];
GO

IF OBJECT_ID(N'[dbo].[FK_GF_QuizGF_Response]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Response] DROP CONSTRAINT [FK_GF_QuizGF_Response];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentUserPrincipal]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_TournamentUser] DROP CONSTRAINT [FK_GF_TournamentUserPrincipal];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_TournamentUserGF_BetHisory]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_BetHistory] DROP CONSTRAINT [FK_GF_TournamentUserGF_BetHisory];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_Skills_inherits_GF_Achievement]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Achievement_GF_Skills] DROP CONSTRAINT [FK_GF_Skills_inherits_GF_Achievement];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_Badge_inherits_GF_Achievement]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Achievement_GF_Badge] DROP CONSTRAINT [FK_GF_Badge_inherits_GF_Achievement];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_Certificate_inherits_GF_Achievement]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Achievement_GF_Certificate] DROP CONSTRAINT [FK_GF_Certificate_inherits_GF_Achievement];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_ExternalTournament_inherits_GF_Tournament]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Tournament_GF_ExternalTournament] DROP CONSTRAINT [FK_GF_ExternalTournament_inherits_GF_Tournament];
GO
IF OBJECT_ID(N'[dbo].[FK_GF_InternalTournament_inherits_GF_Tournament]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[GF_Tournament_GF_InternalTournament] DROP CONSTRAINT [FK_GF_InternalTournament_inherits_GF_Tournament];
GO



--Remove tables
IF OBJECT_ID(N'[dbo].[GF_Achievement]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Achievement];
GO
IF OBJECT_ID(N'[dbo].[GF_AssignedAchievement]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_AssignedAchievement];
GO
IF OBJECT_ID(N'[dbo].[GF_Accolade]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Accolade];
GO
IF OBJECT_ID(N'[dbo].[GF_AssignedCertificate]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_AssignedCertificate];
GO
IF OBJECT_ID(N'[dbo].[GF_AssignedBadge]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_AssignedBadge];
GO
IF OBJECT_ID(N'[dbo].[GF_AssignedSkill]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_AssignedSkill];
GO
IF OBJECT_ID(N'[dbo].[GF_SkillLevel]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_SkillLevel];
GO
IF OBJECT_ID(N'[dbo].[GF_Quiz]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Quiz];
GO
IF OBJECT_ID(N'[dbo].[GF_Field]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Field];
GO
IF OBJECT_ID(N'[dbo].[GF_Option]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Option];
GO
IF OBJECT_ID(N'[dbo].[GF_Response]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Response];
GO
IF OBJECT_ID(N'[dbo].[GF_ResponseField]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_ResponseField];
GO
IF OBJECT_ID(N'[dbo].[GF_QuizMembers]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_QuizMembers];
GO
IF OBJECT_ID(N'[dbo].[GF_QuizAdmin]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_QuizAdmin];
GO
IF OBJECT_ID(N'[dbo].[GF_Tournament]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Tournament];
GO
IF OBJECT_ID(N'[dbo].[GF_TournamentAdmin]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_TournamentAdmin];
GO
IF OBJECT_ID(N'[dbo].[GF_TournamentMember]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_TournamentMember];
GO
IF OBJECT_ID(N'[dbo].[GF_SpecialBet]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_SpecialBet];
GO
IF OBJECT_ID(N'[dbo].[GF_SpecialbetOption]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_SpecialbetOption];
GO
IF OBJECT_ID(N'[dbo].[GF_Game]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Game];
GO
IF OBJECT_ID(N'[dbo].[GF_ExternalTeam]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_ExternalTeam];
GO
IF OBJECT_ID(N'[dbo].[GF_Placedbet]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Placedbet];
GO
IF OBJECT_ID(N'[dbo].[GF_PlacedGameBet]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_PlacedGameBet];
GO
IF OBJECT_ID(N'[dbo].[GF_PlacedSpecialbet]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_PlacedSpecialbet];
GO
IF OBJECT_ID(N'[dbo].[GF_TournamentUser]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_TournamentUser];
GO
IF OBJECT_ID(N'[dbo].[GF_InteralTeam]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_InteralTeam];
GO
IF OBJECT_ID(N'[dbo].[GF_QuizAction]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_QuizAction];
GO
IF OBJECT_ID(N'[dbo].[GF_TournamentAction]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_TournamentAction];
	
IF OBJECT_ID(N'[dbo].[GF_BetHistory]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_BetHistory];
GO
IF OBJECT_ID(N'[dbo].[GF_Achievement_GF_Skills]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Achievement_GF_Skills];
GO
IF OBJECT_ID(N'[dbo].[GF_Achievement_GF_Badge]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Achievement_GF_Badge];
GO
IF OBJECT_ID(N'[dbo].[GF_Achievement_GF_Certificate]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Achievement_GF_Certificate];
GO
IF OBJECT_ID(N'[dbo].[GF_Tournament_GF_ExternalTournament]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Tournament_GF_ExternalTournament];
GO
IF OBJECT_ID(N'[dbo].[GF_Tournament_GF_InternalTournament]', 'U') IS NOT NULL
    DROP TABLE [dbo].[GF_Tournament_GF_InternalTournament];