 	ModifiedBy varchar(25) NOT NULL,
 	Active bit NOT NULL,
 	PRIMARY KEY (CountryID,LanguageID,VerificationStatusID)
-);
-
-CREATE TABLE dbo.vEvent (
-	vEventID int IDENTITY(1,1) NOT NULL,
-	title nvarchar(200) NOT NULL,
-	PRIMARY KEY (vEventID)
 );
 
 CREATE TABLE dbo.VOCElement (

;


-- =============================================
-- Author:		Iago Lorenzo Salgueiro
-- Create date: 2012-06-01
-- Description:	Test if the conditions for the
-- alert type 'pricingdetails' are satisfied, 
-- updating user points and enabling or 
-- disabling it profile.
-- =============================================
CREATE PROCEDURE [dbo].[TestAlertPricingDetails]
	@UserID int,
	@PositionID int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	DECLARE @AlertID int
	SET @AlertID = 1
    
    -- First ever check if this type of alert affects this type of user
    IF	dbo.fxCheckAlertAffectsUser(@UserID, @AlertID) = 0 OR
		-- Check that user has that position (this is a position related alert). If it has not (=0), alert will off because doesn't affect:
		(SELECT count(*) FROM userprofilepositions WHERE UserID=@UserID AND PositionID=@PositionID) = 0 OR
		
		-- Check that there are almost one pricing package defined
		EXISTS (SELECT * FROM ProviderPackage
			WHERE ProviderUserID = @UserID
				AND PositionID = @PositionID

	PRIMARY KEY (CountryID,LanguageID,VOCFlagID)
);

CREATE TABLE dbo.VOCIdeas (
	VOCIdeaID int NOT NULL,
	IdeaShortDesc varchar(50) NOT NULL,
	IdeaLongDesc varchar(1000),
	IdeaUpVotes int,
	IdeaDownVotes int,
	VOCExperienceCategoryID int NOT NULL,
	VOCIdeaStatusID int NOT NULL,
	VOCElementID int,
	GitHubIssueID int,
	EstimatedRelease varchar(25),
	CreatedDate datetime NOT NULL,
	UpdatedDate datetime NOT NULL,
	Modifiedby varchar(3) NOT NULL,
	NotesFromBusinessTeam varchar(2000),
	PRIMARY KEY (VOCIdeaID)
);

CREATE TABLE dbo.VOCIdeaStatus (
	VOCIdeaStatusID int NOT NULL,
	VOCIdeaStatusName varchar(50) NOT NULL,
	VOCIdeaStatusDescription varchar(1000),
	CreatedDate datetime NOT NULL,
	UpdatatedDate datetime NOT NULL,
	ModifiedBy varchar(3) NOT NULL,
	PRIMARY KEY (VOCIdeaStatusID)
);

CREATE TABLE dbo.VOCScores (
	VOCScoresID int NOT NULL,
	UserID int NOT NULL,
