IF ((SELECT COUNT(recId) FROM pal_SurfaceActionType WHERE actionType = 'Custom') = 0)
	INSERT INTO pal_SurfaceActionType (actionType, isActive) 
	VALUES ('Custom', 1)


IF ((SELECT COUNT(recId) FROM pal_SurfaceAction WHERE [action] = 'Surface Save') = 0)
	INSERT INTO pal_SurfaceAction (actionType, [action], isActive)
	VALUES (4, 'Surface Save', 1)



TRUNCATE TABLE pal_SurfaceAction
SET IDENTITY_INSERT [dbo].[pal_SurfaceAction] ON 
INSERT [dbo].[pal_SurfaceAction] ([recId], [actionType], [action], [isActive]) VALUES (1, 1, N'VAT', 1)
INSERT [dbo].[pal_SurfaceAction] ([recId], [actionType], [action], [isActive]) VALUES (2, 1, N'Age', 1)
INSERT [dbo].[pal_SurfaceAction] ([recId], [actionType], [action], [isActive]) VALUES (3, 1, N'Gender', 1)
INSERT [dbo].[pal_SurfaceAction] ([recId], [actionType], [action], [isActive]) VALUES (4, 2, N'Copy', 1)
INSERT [dbo].[pal_SurfaceAction] ([recId], [actionType], [action], [isActive]) VALUES (5, 3, N'Visible', 1)
INSERT [dbo].[pal_SurfaceAction] ([recId], [actionType], [action], [isActive]) VALUES (6, 4, N'Surface Save', 1)
SET IDENTITY_INSERT [dbo].[pal_SurfaceAction] OFF
DBCC CHECKIDENT ('pal_SurfaceAction', RESEED, 6);


TRUNCATE TABLE pal_SurfaceActionType
SET IDENTITY_INSERT [dbo].[pal_SurfaceActionType] ON 
INSERT [dbo].[pal_SurfaceActionType] ([recId], [actionType], [isActive]) VALUES (1, N'Calculation', 1)
INSERT [dbo].[pal_SurfaceActionType] ([recId], [actionType], [isActive]) VALUES (2, N'Button', 1)
INSERT [dbo].[pal_SurfaceActionType] ([recId], [actionType], [isActive]) VALUES (3, N'Toggle View', 1)
INSERT [dbo].[pal_SurfaceActionType] ([recId], [actionType], [isActive]) VALUES (4, N'Custom', 1)
SET IDENTITY_INSERT [dbo].[pal_SurfaceActionType] OFF
DBCC CHECKIDENT ('pal_SurfaceActionType', RESEED, 4);




IF NOT EXISTS(
    SELECT *
    FROM sys.columns 
    WHERE Name      = N'surfaceActionId'
      AND Object_ID = Object_ID(N'pal_Surface'))
BEGIN
    ALTER TABLE pal_Surface
	ADD surfaceActionId INT; 
END





TRUNCATE TABLE pal_MSOperationType
SET IDENTITY_INSERT [dbo].[pal_MSOperationType] ON 
INSERT [dbo].[pal_MSOperationType] ([recId], [operationType]) VALUES (1, N'MSV')
INSERT [dbo].[pal_MSOperationType] ([recId], [operationType]) VALUES (2, N'Claim')
INSERT [dbo].[pal_MSOperationType] ([recId], [operationType]) VALUES (3, N'Reversal')
SET IDENTITY_INSERT [dbo].[pal_MSOperationType] OFF
DBCC CHECKIDENT ('pal_MSOperationType', RESEED, 3);


TRUNCATE TABLE pal_NoteType
SET IDENTITY_INSERT [dbo].[pal_NoteType] ON 
INSERT [dbo].[pal_NoteType] ([recId], [noteType], [isActive], [customItem]) VALUES (1, N'General', 1, NULL)
INSERT [dbo].[pal_NoteType] ([recId], [noteType], [isActive], [customItem]) VALUES (2, N'Email', 1, NULL)
INSERT [dbo].[pal_NoteType] ([recId], [noteType], [isActive], [customItem]) VALUES (3, N'Task', 1, NULL)
INSERT [dbo].[pal_NoteType] ([recId], [noteType], [isActive], [customItem]) VALUES (4, N'Surface Item Created', 1, NULL)
INSERT [dbo].[pal_NoteType] ([recId], [noteType], [isActive], [customItem]) VALUES (5, N'Surface Item Changed', 1, NULL)
INSERT [dbo].[pal_NoteType] ([recId], [noteType], [isActive], [customItem]) VALUES (6, N'Statement', 1, NULL)
INSERT [dbo].[pal_NoteType] ([recId], [noteType], [isActive], [customItem]) VALUES (7, N'Payment', 1, NULL)
SET IDENTITY_INSERT [dbo].[pal_NoteType] OFF
DBCC CHECKIDENT ('pal_NoteType', RESEED, 7);