text: -- =====================================================================================================
  -- Generated by Data Dictionary Version 1.0.0.0
  -- Date: 30 March 2017 14:11
  -- Profile: Test Harness Validation
  -- Rulebase Version: ILR Validation Learner 1617, Version 1617.06
  -- =====================================================================================================
  use [$(IntrajobDatabase)]
  go
  if not exists(select schema_id from sys.schemas where name='Rulebase')
  	exec('create schema Rulebase')
  go
  if object_id('[Rulebase].[VAL_Cases]','u') is not null
  	drop table [Rulebase].[VAL_Cases]
  create table [Rulebase].[VAL_Cases]
  	(
  		[Learner_Id] [int] primary key,
  		[CaseData] [xml] not null
  	)
  go
  if object_id('[Rulebase].[VAL_global]','u') is not null
  	drop table [Rulebase].[VAL_global]
  create table [Rulebase].[VAL_global]
  	(
  		[UKPRN] int,
  		[EmployerVersion] varchar(50),
  		[LARSVersion] varchar(50),
  		[OrgVersion] varchar(50),
  		[PostcodeVersion] varchar(50),
  		[RulebaseVersion] varchar(10),
  	)
  go
  if object_id('[Rulebase].[VAL_ValidationError]','u') is not null
  	drop table [Rulebase].[VAL_ValidationError]
  create table [Rulebase].[VAL_ValidationError]
  	(
  		[AimSeqNumber] bigint,
  		[ErrorString] varchar(2000),
  		[FieldValues] varchar(2000),
  		[LearnRefNumber] varchar(100),
  		[RuleId] varchar(50)
  	)
  go
  