edwardbeckett
1/20/2017 - 1:39 AM

jhi_persistent_audit_event_modification.sql

USE [Foo]
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[jhi_persistent_audit_event](
	[event_id] [bigint] IDENTITY(1,1) NOT NULL,
	[principal] [varchar](50) NOT NULL,
	[event_date] [datetime] NULL,
	[event_type] [varchar](255) NULL,
 CONSTRAINT [PK_JHI_PERSISTENT_AUDIT_EVENT] PRIMARY KEY CLUSTERED 
(
	[event_id] 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

CREATE TABLE [dbo].[jhi_persistent_audit_evt_data](
	[event_id] [bigint] NOT NULL,
	[name] [varchar](150) NOT NULL,
	[value] [varchar](255) NULL,
PRIMARY KEY CLUSTERED 
(
	[event_id] ASC,
	[name] 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 [dbo].[jhi_persistent_audit_evt_data]  WITH CHECK ADD  CONSTRAINT [fk_evt_pers_audit_evt_data] FOREIGN KEY([event_id])
REFERENCES [dbo].[jhi_persistent_audit_event] ([event_id])
GO

ALTER TABLE [dbo].[jhi_persistent_audit_evt_data] CHECK CONSTRAINT [fk_evt_pers_audit_evt_data]
GO