apiVersion: v1 data: controlcenter.sql: "-- Generated with Control>Center version 4.4.1.2\n\nSET ROLE \"cc_jdbc\";\n\nSET search_path=\"public\";\n\n-- create database schema\nCREATE OR REPLACE FUNCTION create_language_plpgsql()\nRETURNS BOOLEAN AS $$\n CREATE LANGUAGE plpgsql;\n SELECT TRUE;\n$$ LANGUAGE SQL;\n\nSELECT CASE WHEN NOT\n \ (\n SELECT TRUE AS exists\n FROM pg_language\n WHERE \ lanname = 'plpgsql'\n UNION\n SELECT FALSE AS exists\n ORDER BY exists DESC\n LIMIT 1\n )\nTHEN\n create_language_plpgsql()\nELSE\n \ FALSE\nEND AS plpgsql_created;\n\nDROP FUNCTION create_language_plpgsql();\nCREATE TABLE OpAnalysisAggregator (\n AnalysisAggregatorId bigint not null,\n \ AnalysisObjectId bigint not null,\n Name varchar(256) not null,\n \ MetricName varchar(256) not null,\n Units varchar(256) not null,\n \ AggregationType varchar(256) not null,\n primary key (AnalysisAggregatorId),\n \ unique (AnalysisObjectId, MetricName, Units, AggregationType),\n unique (AnalysisObjectId, Name)\n );\nCREATE TABLE OpAnalysisAggregatorSQL (\n AnalysisAggregatorSQLId bigint not null,\n AnalysisAggregatorId bigint not null,\n JoinTableName varchar(256),\n JoinPKName varchar(256),\n BaseTableName varchar(256),\n \ BaseFKName varchar(256),\n JoinType varchar(256),\n AggregatorSQL varchar(2048) not null,\n SelectSQL varchar(2048),\n primary key (AnalysisAggregatorSQLId)\n );\nCREATE TABLE OpAnalysisObject (\n AnalysisObjectId bigint not null,\n Name varchar(256) not null,\n TableName varchar(256) not null,\n BucketSQL varchar(2048) not null,\n primary key (AnalysisObjectId),\n \ unique (Name)\n );\nCREATE TABLE OpAnalysisRow (\n AnalysisRowId bigint not null,\n AnalysisObjectId bigint not null,\n Name varchar(256) not null,\n primary key (AnalysisRowId),\n unique (AnalysisObjectId, Name)\n );\nCREATE TABLE OpAnalysisRowSQL (\n AnalysisRowSQLId bigint not null,\n AnalysisRowId bigint not null,\n JoinTableName varchar(256) not null,\n JoinPKName varchar(256) not null,\n BaseTableName varchar(256) not null,\n BaseFKName varchar(256) not null,\n JoinType varchar(256) not null,\n SelectSQL varchar(2048),\n primary key (AnalysisRowSQLId)\n \ );\nCREATE TABLE OpApplication (\n ApplicationId bigint not null,\n \ SystemId bigint not null,\n Name varchar(128) not null,\n Description varchar(1024),\n EndJobCutHorizon timestamp,\n IsApplicationNeverAutoGen char(1) not null check (IsApplicationNeverAutoGen in ('N','Y')),\n WarningNotificationGroupId bigint,\n ErrorNotificationGroupId bigint,\n SuccessNotificationGroupId bigint,\n primary key (ApplicationId),\n unique (SystemId, Name)\n \ );\nCREATE TABLE OpAudit (\n AuditId bigint not null,\n UpdateStamp timestamp not null,\n PrincipalId bigint not null,\n PrincipalName varchar(128) not null,\n Verb varchar(32) not null,\n VerbContext varchar(1024),\n ObjectTable varchar(32) not null,\n ObjectId bigint not null,\n ObjectLogicalIdentifier varchar(1024) not null,\n SystemId bigint,\n SystemName varchar(128),\n primary key (AuditId)\n );\nCREATE TABLE OpAutoGenStats (\n AutoGenStatsId bigint not null,\n SystemId bigint not null,\n LastRun timestamp,\n LastNumJobs integer,\n LastStartInclusive timestamp,\n LastEndExclusive timestamp,\n NextRun timestamp,\n \ NextStartInclusive timestamp,\n NextEndExclusive timestamp,\n primary key (AutoGenStatsId),\n unique (SystemId)\n );\nCREATE TABLE OpBridge (\n BridgeId bigint not null,\n HostId bigint not null,\n Port integer not null,\n Path varchar(256),\n IsHttps char(1) not null check (IsHttps in ('N','Y')),\n RPCUsername varchar(128),\n RPCPassword varchar(2048),\n SecurityConfig varchar(256),\n SecurityTypeEnum varchar(64) not null,\n SecurityHashTypeEnum varchar(64) not null,\n kdfIterations integer,\n kdfSalt varchar(2048),\n EligibleForKeyCheck char(1) check (EligibleForKeyCheck in ('N','Y')),\n primary key (BridgeId),\n unique (HostId, Port)\n );\nCREATE TABLE OpCalendar (\n CalendarId bigint not null,\n SystemId bigint not null,\n Name varchar(128) not null,\n \ BookDate varchar(64),\n primary key (CalendarId),\n unique (SystemId, Name)\n );\nCREATE TABLE OpCalendarYear (\n CalendarId bigint not null,\n Year integer not null,\n Days varchar(366),\n primary key (CalendarId, Year)\n );\nCREATE TABLE OpConfigValue (\n ConfigValueId bigint not null,\n Name varchar(128) not null,\n Description varchar(1024),\n \ ValueTypeEnum varchar(64),\n IsHidden char(1) not null check (IsHidden in ('N','Y')),\n Value varchar(2048),\n primary key (ConfigValueId),\n \ unique (Name)\n );\nCREATE TABLE OpDailyCpuUsage (\n DailyCpuUsageId bigint not null,\n KeyId bigint,\n Hostname varchar(128) not null,\n \ ApplicationId bigint not null,\n CollectionDay timestamp not null,\n \ ExecutableEnum varchar(64) not null,\n Username varchar(128) not null,\n HostnamePlace varchar(128) not null,\n AbAgreementEnvironment varchar(128) not null,\n AbAgreementProject varchar(128) not null,\n Value float8,\n primary key (DailyCpuUsageId),\n unique (KeyId, Hostname, ApplicationId, CollectionDay, ExecutableEnum, Username, HostnamePlace, AbAgreementEnvironment, AbAgreementProject)\n );\nCREATE TABLE OpDailyCpuUsageRollupState (\n DailyCpuUsageRollupStateId bigint not null,\n UpdateStamp timestamp not null,\n CollectionDay timestamp not null,\n RollupStateEnum varchar(64) not null,\n primary key (DailyCpuUsageRollupStateId),\n unique (CollectionDay)\n );\nCREATE TABLE OpDay (\n JobDefinitionId bigint not null,\n DayIndex integer not null,\n DayModeEnum varchar(64) not null,\n MonthDayOffset integer,\n \ NonOperationalOffset integer,\n DayOfWeekEnum varchar(64),\n WeekOfMonthEnum varchar(64),\n primary key (JobDefinitionId, DayIndex)\n );\nCREATE TABLE OpEmeExecutable (\n EmeExecutableId bigint not null,\n UpdateStamp timestamp not null,\n AbAirRoot varchar(256) not null,\n AbAirBranch varchar(256) not null,\n EmeUrl varchar(256) not null,\n PublishedEmeName varchar(256),\n primary key (EmeExecutableId),\n unique (AbAirRoot, AbAirBranch, EmeUrl)\n );\nCREATE TABLE OpExecutable (\n ExecutableId bigint not null,\n UpdateStamp timestamp not null,\n SystemId bigint not null,\n Hostname varchar(128) not null,\n ExpandedPath varchar(512) not null,\n ExecutableEnum varchar(64) not null,\n PrototypeExecutableId bigint,\n FrequencyEnum varchar(64) not null,\n Frequency integer not null,\n MicrographEnum varchar(64) not null,\n EmeExecutableId bigint,\n primary key (ExecutableId),\n unique (SystemId, Hostname, ExpandedPath)\n );\nCREATE TABLE OpFileAndEventConstraint (\n FileAndEventConstraintId bigint not null,\n ConstraintDiscriminator varchar(32) not null,\n JobDefinitionId bigint,\n FileURL varchar(4000),\n FileRetryIntervalSec varchar(64),\n \ IsRepeatableForFileCreateTime char(1) check (IsRepeatableForFileCreateTime in ('N','Y')),\n PropertyTypeId bigint,\n IsRegExSyntax char(1) check (IsRegExSyntax in ('N','Y')),\n IsFirstMatchOnly char(1) check (IsFirstMatchOnly in ('N','Y')),\n EventName varchar(256),\n ListSeparator varchar(64),\n \ ConstraintIndex integer,\n primary key (FileAndEventConstraintId)\n \ );\nCREATE TABLE OpFileSystem (\n FileSystemId bigint not null,\n HostId bigint not null,\n Path varchar(512) not null,\n primary key (FileSystemId),\n \ unique (HostId, Path)\n );\nCREATE TABLE OpFileSystemMetric (\n FileSystemMetricId bigint not null,\n FileSystemId bigint not null,\n Name varchar(32) not null,\n Units varchar(255) not null,\n ThresholdComparisonEnum varchar(32),\n WarningThreshold float8,\n ErrorThreshold float8,\n \ primary key (FileSystemMetricId),\n unique (FileSystemId, Name)\n \ );\nCREATE TABLE OpFileSystemMetricValue (\n FileSystemMetricValueId bigint not null,\n FileSystemMetricId bigint not null,\n CollectionTime timestamp not null,\n Value float8 not null,\n primary key (FileSystemMetricValueId),\n \ unique (FileSystemMetricId, CollectionTime)\n );\nCREATE TABLE OpGroupXref (\n ChildPrincipalId bigint not null,\n ParentGroupId bigint not null,\n primary key (ChildPrincipalId, ParentGroupId)\n );\nCREATE TABLE OpHomeView (\n HomeViewId bigint not null,\n UpdateStamp timestamp not null,\n Name varchar(128) not null,\n Ordinal integer not null,\n \ IsMonitored char(1) not null check (IsMonitored in ('N','Y')),\n primary key (HomeViewId),\n unique (Name)\n );\nCREATE TABLE OpHomeViewBox (\n \ HomeViewBoxId bigint not null,\n UpdateStamp timestamp not null,\n \ HomeViewId bigint not null,\n Type varchar(32) not null,\n Name varchar(256) not null,\n Ordinal integer not null,\n primary key (HomeViewBoxId),\n unique (HomeViewId, Type, Name)\n );\nCREATE TABLE OpHost (\n HostId bigint not null,\n HostDiscriminator varchar(32) not null,\n Hostname varchar(255) not null,\n IsMonitored char(1) check (IsMonitored in ('N','Y')),\n Tag varchar(32),\n OperatingSystem varchar(256),\n OperatingSystemDetail varchar(256),\n CpuClass varchar(256),\n \ NumberOfCpus float8,\n NumberOfLogicalCpus float8,\n MaxEffectiveCpu float8,\n CpuSpeedMhz float8,\n MaxWorkload float8,\n IsEphemeralHost char(1) check (IsEphemeralHost in ('N','Y')),\n WarningNotificationGroupId bigint,\n ErrorNotificationGroupId bigint,\n FatalNotificationGroupId bigint,\n HostClusterId bigint,\n NetworkHostName varchar(256),\n \ IsMultiScheduling char(1) check (IsMultiScheduling in ('N','Y')),\n PhysicalHostId bigint,\n primary key (HostId),\n unique (Hostname)\n );\nCREATE TABLE OpHostMetric (\n HostMetricId bigint not null,\n HostId bigint not null,\n Name varchar(32) not null,\n Units varchar(255) not null,\n ThresholdComparisonEnum varchar(32),\n WarningThreshold float8,\n ErrorThreshold float8,\n primary key (HostMetricId),\n \ unique (HostId, Name)\n );\nCREATE TABLE OpHostMetricValue (\n HostMetricValueId bigint not null,\n HostMetricId bigint not null,\n CollectionTime timestamp not null,\n Value float8 not null,\n primary key (HostMetricValueId),\n \ unique (HostMetricId, CollectionTime)\n );\nCREATE TABLE OpJamonHourlyReport (\n ReportId bigint not null,\n Label varchar(1000) not null,\n \ NodeIdentifier varchar(100) not null,\n IntervalStart timestamp not null,\n IntervalEnd timestamp not null,\n Count bigint,\n MeanValue float8,\n StandardDeviation float8,\n MaxValue float8,\n MinValue float8,\n MaxActive float8,\n primary key (ReportId),\n unique (Label, NodeIdentifier, IntervalStart, IntervalEnd)\n );\nCREATE TABLE OpJamonPFSReport (\n ReportId bigint not null,\n Label varchar(1000) not null,\n \ NodeIdentifier varchar(100) not null,\n IntervalStart timestamp not null,\n IntervalEnd timestamp not null,\n Count bigint,\n MeanValue float8,\n StandardDeviation float8,\n MaxValue float8,\n MinValue float8,\n MaxActive float8,\n primary key (ReportId),\n unique (Label, NodeIdentifier, IntervalStart, IntervalEnd)\n );\nCREATE TABLE OpJob (\n JobId bigint not null,\n UpdateStamp timestamp not null,\n JobGuid varchar(64) not null,\n ApplicationId bigint not null,\n ParentJobId bigint,\n JobDefinitionId bigint,\n ScheduledStartTime timestamp,\n \ EffectiveScheduledStartTime timestamp,\n ScheduledStartTimeHHMM varchar(5),\n ExecutableId bigint,\n RerunSuccessorJobId bigint,\n \ RerunPredecessorJobId bigint,\n RerunGuid varchar(64),\n RunCount integer,\n Vmid varchar(64),\n IsPriorRerunJobSucceeded char(1) not null check (IsPriorRerunJobSucceeded in ('N','Y')),\n IsManuallyStopped char(1) check (IsManuallyStopped in ('N','Y')),\n IsForcedJobState char(1) check (IsForcedJobState in ('N','Y')),\n TestSetGuid varchar(64),\n IsRestartable char(1) not null check (IsRestartable in ('N','Y')),\n IsIgnoredAsPredecessor char(1) not null check (IsIgnoredAsPredecessor in ('N','Y')),\n IsIssuesIgnored char(1) not null check (IsIssuesIgnored in ('N','Y')),\n CommandLine varchar(4000) not null,\n JobEnum varchar(64) not null,\n ActionEnum varchar(64),\n \ WorkingDirectory varchar(1024),\n Username varchar(128),\n AbWorkDir varchar(512),\n AbDataDir varchar(1024),\n MonitorDirectory varchar(512),\n \ AbHome varchar(1024) not null,\n RecFile varchar(1024),\n StdoutPath varchar(1024),\n StderrPath varchar(1024),\n TrackingPath varchar(1024),\n \ TrackingChannel varchar(256),\n ResolvedGraphPath varchar(1024),\n \ Version varchar(16),\n AbAgreementEnvironment varchar(128),\n AbAgreementProject varchar(128),\n HostClusterName varchar(256),\n ResolvedHostname varchar(256) not null,\n StateEnum varchar(64) not null,\n EndTime timestamp,\n StartTime timestamp,\n SeverestEventGuid varchar(64),\n \ HighestSeverity integer not null,\n HighestEventGuid varchar(64),\n \ IsMeasured char(1) not null check (IsMeasured in ('N','Y')),\n CPU float8 not null,\n HostCPU float8 not null,\n DriverCPU float8 not null,\n StartupCPU float8 not null,\n RollupCPU float8 not null,\n \ NumViewChildren integer not null,\n NumRunningChildren integer not null,\n ViewParentJobId bigint not null,\n ViewStart timestamp not null,\n ViewEnd timestamp not null,\n MaxViewEndOfCompletedChildren timestamp,\n IsSupportsDependencies char(1) not null check (IsSupportsDependencies in ('N','Y')),\n EmeVersion bigint,\n EmeTag varchar(256),\n EmeStatus varchar(64),\n DerivedName varchar(256) not null,\n JobDefinitionName varchar(128) not null,\n JobDefinitionGroupName varchar(128) not null,\n \ AnalysisDisabled bool,\n TraceId varchar(64),\n TraceDirectoryPath varchar(1024),\n TraceExtraArgs varchar(512),\n IsTracing bool,\n \ EventArrivalIndex integer not null,\n primary key (JobId),\n unique (JobGuid)\n );\nCREATE TABLE OpJobCompletion (\n JobCompletionId bigint not null,\n UpdateStamp timestamp not null,\n WatcherKey varchar(128) not null,\n EndTime timestamp not null,\n primary key (JobCompletionId),\n \ unique (WatcherKey)\n );\nCREATE TABLE OpJobDefinition (\n JobDefinitionId bigint not null,\n UpdateStamp timestamp not null,\n JobDefinitionDiscriminator varchar(32) not null,\n JobDefinitionGuid varchar(64) not null,\n Name varchar(128) not null,\n Description varchar(1024),\n ApplicationId bigint not null,\n ApproveEnum varchar(64),\n AutoIgnoreFailure char(1) check (AutoIgnoreFailure in ('N','Y')),\n AutoIgnoreOnlyLastFailure char(1) check (AutoIgnoreOnlyLastFailure in ('N','Y')),\n EmailOnSuccess char(1) check (EmailOnSuccess in ('N','Y')),\n IsEnabled char(1) check (IsEnabled in ('N','Y')),\n RuntimeId bigint,\n Sandbox varchar(1024),\n \ JobPrefix varchar(256),\n KillExpiredJobs char(1) check (KillExpiredJobs in ('N','Y')),\n IsNoMatchAnError char(1) check (IsNoMatchAnError in ('N','Y')),\n \ DurationDefaultSec integer,\n StdoutFile varchar(1024),\n IsStdoutAppend char(1) check (IsStdoutAppend in ('N','Y')),\n IsStdoutToLog char(1) check (IsStdoutToLog in ('N','Y')),\n StderrFile varchar(1024),\n IsStderrAppend char(1) check (IsStderrAppend in ('N','Y')),\n IsStderrToLog char(1) check (IsStderrToLog in ('N','Y')),\n AutoRerunAttemptWindow integer,\n AutoRerunAttempts integer,\n AutoRerunDelay integer,\n TraceId varchar(64),\n TraceDirectoryPath varchar(1024),\n TraceExtraArgs varchar(512),\n ForceStart varchar(64),\n \ JobDefinitionGroupId bigint,\n SuccessNotificationGroupId bigint,\n \ WarningNotificationGroupId bigint,\n ErrorNotificationGroupId bigint,\n \ IsManuallyGeneratedOnly char(1) check (IsManuallyGeneratedOnly in ('N','Y')),\n \ IsOperatorVisible char(1) check (IsOperatorVisible in ('N','Y')),\n TraceStartDateTime timestamp,\n TraceEndDateTime timestamp,\n ClusterNodeLabel varchar(255),\n \ IsOriginalSLA char(1) check (IsOriginalSLA in ('N','Y')),\n ScheduledStartTime timestamp,\n EffectiveScheduledStartTime timestamp,\n ProductionDayToUse timestamp,\n primary key (JobDefinitionId),\n unique (JobDefinitionGuid, ApproveEnum, ScheduledStartTime, EffectiveScheduledStartTime)\n );\nCREATE TABLE OpJobDefinitionAction (\n JobDefinitionActionId bigint not null,\n \ ActionDiscriminator varchar(32) not null,\n JobDefinitionId bigint,\n \ ExecutablePath varchar(256),\n ExecutableEnum varchar(64),\n WorkingDirectory varchar(256),\n IsEnabled char(1) check (IsEnabled in ('N','Y')),\n IsNotification char(1) check (IsNotification in ('N','Y')),\n DurationSec integer,\n AutoIgnoreIssue char(1) check (AutoIgnoreIssue in ('N','Y')),\n ActionEnum varchar(64),\n \ primary key (JobDefinitionActionId)\n );\nCREATE TABLE OpJobDefinitionActionArgument (\n JobDefinitionActionId bigint not null,\n ArgumentIndex integer not null,\n Value varchar(4000),\n IsExpandable char(1) not null check (IsExpandable in ('N','Y')),\n primary key (JobDefinitionActionId, ArgumentIndex)\n );\nCREATE TABLE OpJobDefinitionDependency (\n JobDefinitionId bigint not null,\n PredecessorJobDefinitionGuid varchar(64) not null,\n \ primary key (JobDefinitionId, PredecessorJobDefinitionGuid)\n );\nCREATE TABLE OpJobDefinitionPropertyValue (\n JobDefinitionId bigint not null,\n \ PropertyTypeId bigint not null,\n PropertyValue varchar(1024),\n \ IsWildcard char(1) not null check (IsWildcard in ('N','Y')),\n primary key (JobDefinitionId, PropertyTypeId)\n );\nCREATE TABLE OpJobDefinitionStats (\n JobDefinitionStatsId bigint not null,\n JobDefinitionGuid varchar(255) not null,\n ScheduledStartTimeHHMM varchar(5) not null,\n NumSuccessfulJobs integer not null,\n AvgStartDelaySec float8 not null,\n AvgDurationSec float8 not null,\n primary key (JobDefinitionStatsId),\n unique (JobDefinitionGuid, ScheduledStartTimeHHMM)\n );\nCREATE TABLE OpJobEvent (\n \ JobEventId bigint not null,\n JobEventGuid varchar(64) not null,\n \ JobId bigint not null,\n EventTypeEnum varchar(64) not null,\n \ EventSeverity integer not null,\n EventTime timestamp not null,\n \ ArrivalOrder integer not null,\n Source varchar(64),\n EventValue varchar(512),\n Summary varchar(512),\n Detail varchar(1024),\n \ Username varchar(1024),\n JobActionComment varchar(1024),\n primary key (JobEventId),\n unique (JobEventGuid)\n );\nCREATE TABLE OpJobPredictedState (\n JobId bigint not null,\n IsWedged char(1) not null check (IsWedged in ('N','Y')),\n PredictedStartTime timestamp,\n PredictedEndTime timestamp,\n HighestSeverity integer not null,\n LateStartTime timestamp,\n \ ExpiredStartTime timestamp,\n LateEndTime timestamp,\n ExpiredEndTime timestamp,\n primary key (JobId)\n );\nCREATE TABLE OpJobPropertyValue (\n JobId bigint not null,\n PropertyTypeId bigint not null,\n PropertyValue varchar(1024),\n primary key (JobId, PropertyTypeId)\n );\nCREATE TABLE OpJobSet (\n JobSetId bigint not null,\n UpdateStamp timestamp not null,\n JobSetGuid varchar(128) not null,\n Name varchar(128) not null,\n IsMonitored char(1) not null check (IsMonitored in ('N','Y')),\n \ SystemId bigint,\n HostName varchar(255),\n GroupByName varchar(32) not null,\n GroupByLabel varchar(256),\n FilterText varchar(1024),\n BadStatusTypeEnum varchar(64) not null,\n IssuesSeverityOrderEnum varchar(64) not null,\n OrderByName varchar(32) not null,\n IsOrderAscending char(1) not null check (IsOrderAscending in ('N','Y')),\n IsShowOrderByLabel char(1) not null check (IsShowOrderByLabel in ('N','Y')),\n JobMax integer not null,\n Tag varchar(32),\n primary key (JobSetId),\n unique (Name),\n unique (JobSetGuid)\n );\nCREATE TABLE OpKey (\n KeyId bigint not null,\n KeyGuid varchar(512) not null,\n Hostname varchar(128),\n \ HostRole varchar(512),\n CoreRating float8,\n CustomerProject varchar(512),\n CustomerRole varchar(512),\n NumberOfCpus float8,\n \ NumberOfLogicalCpus float8,\n primary key (KeyId),\n unique (KeyGuid)\n );\nCREATE TABLE OpKeyFile (\n KeyFileId bigint not null,\n \ KeyId bigint not null,\n ImportTime timestamp not null,\n KeyDocument text not null,\n primary key (KeyFileId),\n unique (KeyId)\n );\nCREATE TABLE OpKeyServerReport (\n KeyServerReportId bigint not null,\n UpdateStamp timestamp not null,\n ProductId bigint not null,\n JobId varchar(64) not null,\n ReportStatus varchar(64) not null,\n ReportMode varchar(64) not null,\n ErrorMessage varchar(64) not null,\n Report text not null,\n primary key (KeyServerReportId)\n );\nCREATE TABLE OpLogAlertRule (\n LogAlertRuleId bigint not null,\n LogAlertPattern varchar(1024) not null,\n DataBaseType varchar(64),\n CustomErrorMessage varchar(1024),\n \ IsTableSpaceError char(1) not null check (IsTableSpaceError in ('N','Y')),\n \ IsEnabled char(1) not null check (IsEnabled in ('N','Y')),\n primary key (LogAlertRuleId),\n unique (LogAlertPattern)\n );\nCREATE TABLE OpMetric (\n MetricId bigint not null,\n ExecutableId bigint,\n \ EmeExecutableId bigint,\n Name varchar(128) not null,\n Expression varchar(1024) not null,\n IsRuntime char(1) not null check (IsRuntime in ('N','Y')),\n IsSummary char(1) not null check (IsSummary in ('N','Y')),\n \ Units varchar(255),\n WarningExpression varchar(255),\n ErrorExpression varchar(255),\n MinimumVersion varchar(32),\n FrequencyEnum varchar(64),\n \ Frequency integer,\n primary key (MetricId),\n unique (ExecutableId, EmeExecutableId, Name)\n );\nCREATE TABLE OpMetricValue (\n MetricValueId bigint not null,\n JobId bigint not null,\n MetricId bigint not null,\n CollectionTime timestamp not null,\n IsSummary char(1) not null check (IsSummary in ('N','Y')),\n Hostname varchar(128),\n KeyId bigint,\n Value float8,\n StringValue varchar(255),\n Error varchar(1024),\n ApplicationId bigint not null,\n SystemId bigint not null,\n ExecutableId bigint,\n JobDefinitionGuid varchar(64),\n \ JobGuid varchar(64) not null,\n Bucket bigint not null,\n ActionEnum varchar(64),\n StateEnum varchar(64) not null,\n ScheduledStartTime timestamp,\n ScheduledStartTimeHHMM varchar(5),\n AnalysisDisabled bool,\n primary key (MetricValueId),\n unique (JobId, MetricId, CollectionTime, IsSummary, Hostname, KeyId)\n );\nCREATE TABLE OpMonitoredEvent (\n MonitoredEventId bigint not null,\n UpdateStamp timestamp not null,\n EventTypeDiscriminator varchar(32) not null,\n MonitoredEventGuid varchar(128) not null,\n ErrorCode varchar(64),\n EventCategory varchar(64),\n EventSeverity integer not null,\n EventTime timestamp not null,\n EventValue varchar(512),\n Summary varchar(512),\n Detail varchar(1024),\n SourceObjectGuid varchar(128),\n SourceObjectType varchar(32),\n LifecycleState varchar(32) not null,\n DismissComment varchar(1024),\n MonitoredObjectGuid varchar(256) not null,\n RepeatCount integer,\n RepeatStartTime timestamp,\n SystemId bigint,\n ReporterId bigint,\n ProductId bigint,\n HostId bigint,\n primary key (MonitoredEventId),\n unique (MonitoredEventGuid)\n );\nCREATE TABLE OpMonitoredStatus (\n MonitoredStatusId bigint not null,\n StatusTypeDiscriminator varchar(32) not null,\n LastEventId bigint,\n SeverestEventId bigint,\n \ HostId bigint,\n ProductId bigint,\n ReporterId bigint,\n \ SystemId bigint,\n primary key (MonitoredStatusId)\n );\nCREATE TABLE OpNotificationGroup (\n NotificationGroupId bigint not null,\n Name varchar(128) not null,\n Description varchar(1024),\n primary key (NotificationGroupId),\n unique (Name)\n );\nCREATE TABLE OpNotificationGroupRecipient (\n NotificationGroupId bigint not null,\n RecipientId bigint not null,\n primary key (NotificationGroupId, RecipientId)\n );\nCREATE TABLE OpOSAuthentication (\n OSAuthenticationId bigint not null,\n OSAuthenticationGuid varchar(64) not null,\n OSAuthenticationTypeEnum varchar(64) not null,\n \ HostId bigint,\n VirtualHostname varchar(256),\n Username varchar(128),\n Password varchar(2048),\n FunctionalUser varchar(256),\n \ primary key (OSAuthenticationId),\n unique (HostId, VirtualHostname, Username, FunctionalUser),\n unique (OSAuthenticationGuid)\n );\nCREATE TABLE OpPrincipal (\n PrincipalId bigint not null,\n PrincipalDiscriminator varchar(32) not null,\n Name varchar(128) not null,\n LCName varchar(128) not null,\n DisplayName varchar(128),\n Description varchar(1024),\n \ IsBuiltin char(1) not null check (IsBuiltin in ('N','Y')),\n IsEnabled char(1) check (IsEnabled in ('N','Y')),\n Password varchar(2048),\n primary key (PrincipalId),\n unique (LCName),\n unique (Name)\n );\nCREATE TABLE OpPrivilege (\n PrivilegeId bigint not null,\n PrincipalId bigint not null,\n RoleEnum varchar(32) not null,\n SystemId bigint,\n \ primary key (PrivilegeId),\n unique (PrincipalId, RoleEnum, SystemId)\n \ );\nCREATE TABLE OpProduct (\n ProductId bigint not null,\n UpdateStamp timestamp not null,\n ProductGuid varchar(128) not null,\n ProductTypeId bigint not null,\n ProductName varchar(256) not null,\n Version varchar(128),\n Description varchar(256),\n IsDetected char(1) not null check (IsDetected in ('N','Y')),\n IsItThisCC char(1) not null check (IsItThisCC in ('N','Y')),\n IsMonitored char(1) not null check (IsMonitored in ('N','Y')),\n Tag varchar(32),\n HostId bigint not null,\n MonitorDirectory varchar(512),\n ConfigurationUser varchar(64),\n ContextRoot varchar(128),\n \ Url varchar(512),\n LogFilePath varchar(1024),\n AbApplicationHub varchar(1024),\n AbHome varchar(1024),\n AbWorkDir varchar(512),\n \ AbDataDir varchar(1024),\n RootDirectory varchar(1024),\n WorkDir varchar(1024),\n ConfigFile varchar(1024),\n JdbcUrl varchar(256),\n \ KeyNumCpus varchar(64),\n KeyExpiryDate timestamp,\n KeyFilePath varchar(1024),\n Port integer,\n KeyServerGroup varchar(256),\n \ KeyBundleId varchar(256),\n KeyBundleKeyType varchar(32),\n PathEnvValue varchar(1024),\n StartCommandString varchar(256),\n StopCommandString varchar(256),\n RestartCommandString varchar(256),\n StatusCommandString varchar(256),\n GoodStatusRegex varchar(512),\n GoodStatusText varchar(128),\n \ BadStatusRegex varchar(512),\n BadStatusText varchar(128),\n ProductStatusEnum varchar(64) not null,\n WarningNotificationGroupId bigint,\n ErrorNotificationGroupId bigint,\n FatalNotificationGroupId bigint,\n primary key (ProductId),\n \ unique (ProductName),\n unique (ProductGuid)\n );\nCREATE TABLE OpProductType (\n ProductTypeId bigint not null,\n TypeName varchar(64) not null,\n ProductName varchar(256) not null,\n ProductNameString varchar(256),\n ProductVendor varchar(128) not null,\n ProductVariety varchar(16) not null,\n KeyFileProductId varchar(64),\n IsAddByAdmin char(1) not null check (IsAddByAdmin in ('N','Y')),\n ConfigurationUserTreatment varchar(16) not null,\n ContextRootTreatment varchar(16) not null,\n UrlTreatment varchar(16) not null,\n LogFilePathTreatment varchar(16) not null,\n AbHomeTreatment varchar(16) not null,\n AbApplicationHubTreatment varchar(16) not null,\n \ AbWorkDirTreatment varchar(16) not null,\n AbDataDirTreatment varchar(16) not null,\n RootDirectoryTreatment varchar(16) not null,\n WorkDirTreatment varchar(16) not null,\n ConfigFileTreatment varchar(16) not null,\n PortTreatment varchar(16) not null,\n VersionTreatment varchar(16) not null,\n RootDirectoryEnvVar varchar(64),\n StartCommandString varchar(256),\n StopCommandString varchar(256),\n RestartCommandString varchar(256),\n StatusCommandString varchar(256),\n GoodStatusRegex varchar(512),\n GoodStatusText varchar(128),\n \ BadStatusRegex varchar(512),\n BadStatusText varchar(128),\n AbAppIdentifier varchar(256),\n primary key (ProductTypeId),\n unique (TypeName)\n \ );\nCREATE TABLE OpProductXref (\n LeftProductId bigint not null,\n \ ProductRelationship varchar(16) not null,\n RightProductId bigint not null,\n primary key (LeftProductId, ProductRelationship, RightProductId)\n \ );\nCREATE TABLE OpPropertyType (\n PropertyTypeId bigint not null,\n \ PropertyTypeDiscriminator varchar(32) not null,\n SystemId bigint not null,\n Name varchar(128) not null,\n Description varchar(1024),\n \ MarkForDelete char(1) check (MarkForDelete in ('N','Y')),\n ColumnSequence integer not null,\n DefaultValue varchar(1024),\n CustomTypeEnum varchar(64),\n BuiltinPropertyExpression varchar(256),\n primary key (PropertyTypeId),\n unique (SystemId, ColumnSequence),\n unique (SystemId, Name)\n );\nCREATE TABLE OpQueue (\n QueueId bigint not null,\n \ UpdateStamp timestamp not null,\n HostId bigint not null,\n Directory varchar(256) not null,\n MonitorDirectory varchar(512),\n SystemId bigint not null,\n Name varchar(128) not null,\n QueueType varchar(256) not null,\n QueueVersion integer not null,\n Owner varchar(128) not null,\n NumPartitions integer not null,\n QueueAttributes varchar(256),\n \ WarningNotificationGroupId bigint,\n ErrorNotificationGroupId bigint,\n \ IsIssuesIgnored char(1) not null check (IsIssuesIgnored in ('N','Y')),\n \ IsQueueDeleted char(1) not null check (IsQueueDeleted in ('N','Y')),\n \ primary key (QueueId),\n unique (SystemId, Name),\n unique (HostId, Directory)\n );\nCREATE TABLE OpQueueClient (\n QueueClientId bigint not null,\n QueueId bigint not null,\n QueueSubscriberId bigint,\n JobId bigint not null,\n GraphComponent varchar(256) not null,\n GraphComponentEnum varchar(32) not null,\n EventTime timestamp not null,\n primary key (QueueClientId)\n );\nCREATE TABLE OpQueueMetric (\n QueueMetricId bigint not null,\n QueueMetricDiscriminator varchar(32) not null,\n ThresholdComparisonEnum varchar(32) not null,\n WarningThreshold integer,\n ErrorThreshold integer,\n MetricEnum varchar(32) not null,\n QueueId bigint,\n QueueSubscriberId bigint,\n primary key (QueueMetricId)\n );\nCREATE TABLE OpQueueMetricValue (\n QueueMetricValueId bigint not null,\n QueueMetricId bigint not null,\n CollectionTime timestamp not null,\n Value float8 not null,\n MetricStatusEnum varchar(32) not null,\n primary key (QueueMetricValueId),\n unique (QueueMetricId, CollectionTime)\n );\nCREATE TABLE OpQueueStats (\n QueueStatsId bigint not null,\n QueueId bigint not null,\n LastCollectionTime timestamp not null,\n QueueStatusEnum varchar(32) not null,\n LastAlertTime timestamp,\n primary key (QueueStatsId),\n unique (QueueId)\n );\nCREATE TABLE OpQueueSubscriber (\n QueueSubscriberId bigint not null,\n QueueId bigint not null,\n IdSubdirectory varchar(256) not null,\n IsIssuesIgnored char(1) not null check (IsIssuesIgnored in ('N','Y')),\n IsSubscriberDeleted char(1) not null check (IsSubscriberDeleted in ('N','Y')),\n primary key (QueueSubscriberId)\n );\nCREATE TABLE OpQuickLink (\n QuickLinkId bigint not null,\n Name varchar(128),\n Description varchar(1024),\n Url varchar(2048),\n IconName varchar(128),\n IsHidden char(1) not null check (IsHidden in ('N','Y')),\n Sequence integer not null,\n primary key (QuickLinkId)\n );\nCREATE TABLE OpRecipient (\n RecipientId bigint not null,\n RecipientTypeDiscriminator varchar(32) not null,\n Name varchar(128) not null,\n Description varchar(1024),\n EmailAddresses varchar(2048),\n HttpAddress varchar(2048),\n primary key (RecipientId),\n \ unique (Name)\n );\nCREATE TABLE OpRecipientHeader (\n RecipientHeaderId bigint not null,\n RecipientId bigint not null,\n Type varchar(64) not null,\n Name varchar(128) not null,\n Value varchar(1024),\n \ Sequence integer not null,\n Properties varchar(1024),\n primary key (RecipientHeaderId),\n unique (RecipientId, Type, Name)\n );\nCREATE TABLE OpReporter (\n ReporterId bigint not null,\n PhysicalHostId bigint not null,\n WorkingDirectory varchar(512) not null,\n ReporterGuid varchar(128) not null,\n ProductId bigint,\n LogicalHostId bigint not null,\n Username varchar(128),\n AbHome varchar(256),\n ReporterUserModeEnum varchar(32),\n IsScheduling char(1) check (IsScheduling in ('N','Y')),\n \ WebServiceVersion varchar(16) not null,\n ReporterConfigPath varchar(256),\n \ ReporterLogPath varchar(256),\n LastWebServiceTime timestamp not null,\n IsStopped char(1) check (IsStopped in ('N','Y')),\n IncludeInCCStatus char(1) not null check (IncludeInCCStatus in ('N','Y')),\n NeedsRestart char(1) not null check (NeedsRestart in ('N','Y')),\n ReporterConfigSetId bigint,\n primary key (ReporterId),\n unique (PhysicalHostId, WorkingDirectory)\n \ );\nCREATE TABLE OpReporterConfigItem (\n ReporterConfigItemId bigint not null,\n PropertyTypeDiscriminator varchar(32) not null,\n ReporterDefaultConfigItemId bigint,\n LongValue bigint,\n DoubleValue float8,\n StringValue varchar(1024),\n BooleanValue char(1) check (BooleanValue in ('N','Y')),\n \ PasswordValue varchar(2048),\n ReporterConfigSetId bigint not null,\n \ primary key (ReporterConfigItemId)\n );\nCREATE TABLE OpReporterConfigSet (\n ReporterConfigSetId bigint not null,\n Name varchar(256) not null,\n Source varchar(1024) not null,\n Version varchar(64) not null,\n Description varchar(1024),\n ReporterConfigSetType varchar(32) not null,\n ReporterConfigSetPatternType varchar(32),\n ReporterConfigSetPattern varchar(1024),\n primary key (ReporterConfigSetId),\n unique (Name)\n \ );\nCREATE TABLE OpReporterDefaultConfigItem (\n ReporterDefaultConfigItemId bigint not null,\n Name varchar(256) not null,\n StartVersion varchar(16) not null,\n EndVersion varchar(16),\n Description varchar(255),\n \ ItemType varchar(64) not null,\n Value varchar(255),\n ReporterParameterGroupType varchar(32) not null,\n ReporterConfigValueType varchar(32) not null,\n \ primary key (ReporterDefaultConfigItemId),\n unique (Name)\n );\nCREATE TABLE OpReporterDirectory (\n ReporterId bigint not null,\n Directory varchar(256)\n );\nCREATE TABLE OpResourcePart (\n ResourcePartId bigint not null,\n UpdateStamp timestamp not null,\n ResourceRequestId bigint not null,\n ResourceSettingId bigint not null,\n InstanceName varchar(256),\n RequiredQuantity integer not null,\n primary key (ResourcePartId),\n unique (ResourceRequestId, ResourceSettingId)\n );\nCREATE TABLE OpResourcePool (\n ResourcePoolId bigint not null,\n UpdateStamp timestamp not null,\n ResourceServerId bigint not null,\n Url varchar(512) not null,\n primary key (ResourcePoolId),\n unique (ResourceServerId, Url)\n );\nCREATE TABLE OpResourceRequest (\n ResourceRequestId bigint not null,\n UpdateStamp timestamp not null,\n ResourceRequestDiscriminator varchar(32) not null,\n ResourceServerId bigint not null,\n Handle integer not null,\n WhenRequested timestamp,\n WhenGranted timestamp,\n \ ClientSandboxUrl varchar(1024),\n ClientProject varchar(1024),\n \ ClientPlanName varchar(1024),\n ClientPrincipal varchar(256),\n \ ClientJobGuid varchar(256),\n ResourceTaskName varchar(1024),\n \ ResourcePriority integer,\n ResourceIsTentative char(1) check (ResourceIsTentative in ('N','Y')),\n ResourceEventName varchar(1024),\n primary key (ResourceRequestId),\n unique (ResourceServerId, Handle)\n );\nCREATE TABLE OpResourceServer (\n ResourceServerId bigint not null,\n UpdateStamp timestamp not null,\n Hostname varchar(256) not null,\n AbWorkDir varchar(512) not null,\n MonitorDirectory varchar(512),\n ArrivalOrder integer not null,\n StartStamp timestamp,\n StopStamp timestamp,\n \ ProductId bigint,\n primary key (ResourceServerId),\n unique (Hostname, AbWorkDir)\n );\nCREATE TABLE OpResourceSetting (\n ResourceSettingId bigint not null,\n UpdateStamp timestamp not null,\n ResourcePoolId bigint not null,\n SettingName varchar(256) not null,\n IsGroup char(1) not null check (IsGroup in ('N','Y')),\n SettingGroup varchar(256),\n \ MaxQuantity integer not null,\n UsedQuantity integer not null,\n \ IsVariable char(1) not null check (IsVariable in ('N','Y')),\n primary key (ResourceSettingId),\n unique (ResourcePoolId, SettingName, IsGroup)\n \ );\nCREATE TABLE OpRuntime (\n RuntimeId bigint not null,\n RuntimeTypeDiscriminator varchar(32) not null,\n Name varchar(128) not null,\n OSAuthenticationId bigint not null,\n BridgeId bigint not null,\n AbHome varchar(256) not null,\n SystemId bigint,\n FilesystemRoot varchar(1024),\n SchedulingHostId bigint,\n ConfigEnvGuid varchar(64),\n Tag varchar(32),\n primary key (RuntimeId),\n unique (Name, SystemId)\n );\nCREATE TABLE OpSystem (\n SystemId bigint not null,\n UpdateStamp timestamp not null,\n \ SystemGuid varchar(128) not null,\n Name varchar(128) not null,\n \ Description varchar(1024),\n ProductionDayHHMM varchar(64) not null,\n TimeZoneId varchar(64) not null,\n ExcludeJobColumns varchar(1024),\n \ ExcludeJobDefinitionColumns varchar(1024),\n IsAutoGenEnabled char(1) not null check (IsAutoGenEnabled in ('N','Y')),\n AutoGenRangeMins integer not null,\n AutoGenOffsetMins integer not null,\n AutoGenDailyFrequency integer not null,\n MarkForDelete char(1) not null check (MarkForDelete in ('N','Y')),\n primary key (SystemId),\n unique (Name),\n unique (SystemGuid)\n );\nCREATE TABLE OpTimeConstraint (\n JobDefinitionId bigint not null,\n ModeEnum varchar(64) not null,\n StartDate timestamp,\n \ EndDate timestamp,\n TimeZoneId varchar(128),\n StartTimes varchar(512),\n MonthsOfYear varchar(64),\n CalendarId bigint,\n \ primary key (JobDefinitionId)\n );\nCREATE TABLE OpZMVDenormalizedDay (\n DenormalizedDayId bigint not null,\n JobId bigint not null,\n \ ApplicationId bigint not null,\n ExecutableId bigint,\n Hostname varchar(128),\n KeyId bigint,\n MetricId bigint not null,\n CollectionDay timestamp not null,\n CollectionTime timestamp not null,\n Value float8,\n primary key (DenormalizedDayId),\n unique (JobId, ApplicationId, ExecutableId, Hostname, KeyId, MetricId, CollectionDay, CollectionTime)\n );\nCREATE TABLE OpZMVDifference (\n DifferenceId bigint not null,\n JobId bigint not null,\n ApplicationId bigint not null,\n ExecutableId bigint,\n Hostname varchar(128),\n KeyId bigint,\n MetricId bigint not null,\n CollectionDay timestamp not null,\n CollectionTime timestamp not null,\n Value float8,\n primary key (DifferenceId),\n \ unique (JobId, ApplicationId, ExecutableId, Hostname, KeyId, MetricId, CollectionDay, CollectionTime)\n );\n-- create constraints\ncreate sequence hibernate_sequence start with 1 increment by 1;\n \ncreate index IDX_JDPROPVALUE_PROPTYPEID \n on OpJobDefinitionPropertyValue (PropertyTypeId);\n \ncreate index IDX_JOBPROPVALUE_PROPTYPEID \n on OpJobPropertyValue (PropertyTypeId);\n \nalter table if exists OpAnalysisAggregator \n add constraint FKrfit5fi48b9jragbnu88jte7b \n foreign key (AnalysisObjectId) \n references OpAnalysisObject;\n \nalter table if exists OpAnalysisAggregatorSQL \n add constraint FK1hnbwq56yhs2yuy1d4cooh4l8 \n foreign key (AnalysisAggregatorId) \n references OpAnalysisAggregator;\n \nalter table if exists OpAnalysisRow \n add constraint FKkck9t25618jy83xsleeoeiovw \n foreign key (AnalysisObjectId) \n references OpAnalysisObject;\n \nalter table if exists OpAnalysisRowSQL \n add constraint FKjrb0ul88q3jv0u0frxwrq0e2 \n foreign key (AnalysisRowId) \n references OpAnalysisRow;\n \nalter table if exists OpApplication \n \ add constraint FKkdgdh04oj75sec9dwiyhg16ye \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpApplication \n add constraint FKmc3ylwrh5i9d0aakg5vk8rlx5 \n foreign key (WarningNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpApplication \n add constraint FKc9bq3d4daq4ee597etpnm4g97 \n foreign key (ErrorNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpApplication \n add constraint FKjpcf8tq0npea5s9mf6tbrrioi \n foreign key (SuccessNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpAutoGenStats \n add constraint FKs0xei25r31jtsghpelm9p3sg0 \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpBridge \n add constraint FKm1n717usrfscv5xywbh93kotc \n foreign key (HostId) \n references OpHost;\n \nalter table if exists OpCalendar \n add constraint FK37katf1nkit4d6okja33erenk \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpCalendarYear \n add constraint FKci2yumr9qfmm7es3n6b2xbc4 \n \ foreign key (CalendarId) \n references OpCalendar;\n \nalter table if exists OpDailyCpuUsage \n add constraint FKshn2d7ldgnpjt8wids5ffhog3 \n foreign key (KeyId) \n references OpKey;\n \nalter table if exists OpDailyCpuUsage \n add constraint FKi9hybiyfiu4k57mog9cp3d5ve \n foreign key (ApplicationId) \n references OpApplication;\n \nalter table if exists OpDay \n add constraint FKbtr4fr587l83sp43h7b0nkgrf \n foreign key (JobDefinitionId) \n references OpTimeConstraint;\n \nalter table if exists OpExecutable \n add constraint FK1o5714a6kc0h91ohhjf6womjm \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpExecutable \n add constraint FKk2hb991clofp9lrgyuxe617hd \n foreign key (PrototypeExecutableId) \n references OpExecutable;\n \nalter table if exists OpExecutable \n add constraint FKn6n881daxoes4m1jmjmybor4y \n foreign key (EmeExecutableId) \n references OpEmeExecutable;\n \nalter table if exists OpFileAndEventConstraint \n add constraint FKeyxv51r0ufj61m24wku8777m \n foreign key (JobDefinitionId) \n references OpJobDefinition;\n \nalter table if exists OpFileAndEventConstraint \n add constraint FK6426q08fm01ultq8g5ul2x2io \n foreign key (PropertyTypeId) \n references OpPropertyType;\n \nalter table if exists OpFileSystem \n \ add constraint FKk1o6ur8hu9b7rkxoxvn2ccp3n \n foreign key (HostId) \n references OpHost;\n \nalter table if exists OpFileSystemMetric \n add constraint FKe211qe0w7lql8o9ip4dnu9ept \n foreign key (FileSystemId) \n \ references OpFileSystem;\n \nalter table if exists OpFileSystemMetricValue \n add constraint FKefhmrbke9v6hjj6xc8n7d7k5y \n foreign key (FileSystemMetricId) \n references OpFileSystemMetric;\n \nalter table if exists OpGroupXref \n add constraint FKnsceus2ues6hh1q9h6660xdbx \n foreign key (ParentGroupId) \n references OpPrincipal;\n \nalter table if exists OpGroupXref \n add constraint FK4dk4e99w6vm2f4ljj3roopiqe \n foreign key (ChildPrincipalId) \n references OpPrincipal;\n \nalter table if exists OpHomeViewBox \n add constraint FK1au4or6bwn2bmv275ia14q2uc \n foreign key (HomeViewId) \n references OpHomeView;\n \nalter table if exists OpHost \n add constraint FK6pxxhbxnx4eyg84vsq7qpju36 \n foreign key (WarningNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpHost \n add constraint FKfrocf12l5kpt8p9ykpi3l757g \n foreign key (ErrorNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpHost \n add constraint FK6q3t3oxkw9ug5ktdhjh6jdcqd \n foreign key (FatalNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpHost \n add constraint FK81x4ia1lxpc5xii088bw204nf \n foreign key (HostClusterId) \n references OpHost;\n \nalter table if exists OpHost \n add constraint FKn3gq0uk9idjjtgrwnavc1fbeu \n foreign key (PhysicalHostId) \n references OpHost;\n \nalter table if exists OpHostMetric \n add constraint FK5ovk29s5qkp3b0uuss5kjqw9i \n foreign key (HostId) \n references OpHost;\n \nalter table if exists OpHostMetricValue \n add constraint FKnyba4hteseqrvjs2wk8pdtdoy \n foreign key (HostMetricId) \n \ references OpHostMetric;\n \nalter table if exists OpJob \n add constraint FKryte4ef9b98pyway03ue994t9 \n foreign key (ApplicationId) \n references OpApplication;\n \nalter table if exists OpJob \n add constraint FKme88sr2rpdmjlbguyt74doma9 \n foreign key (ParentJobId) \n references OpJob;\n \nalter table if exists OpJob \n add constraint FKgb0kywo3kkkm7ool7ac46h3gd \n foreign key (JobDefinitionId) \n references OpJobDefinition;\n \nalter table if exists OpJob \n add constraint FK4x5f4lc1bbxd1byakigqicdg \n foreign key (ExecutableId) \n references OpExecutable;\n \nalter table if exists OpJob \n add constraint FK45aou1q6yltpf6pbbn1eh1bb1 \n foreign key (RerunSuccessorJobId) \n references OpJob;\n \nalter table if exists OpJob \n add constraint FKc38c9mppospavtgvq6rogiok0 \n foreign key (RerunPredecessorJobId) \n references OpJob;\n \nalter table if exists OpJobDefinition \n add constraint FKjamygtsh883or4w03pspxumo1 \n foreign key (ApplicationId) \n \ references OpApplication;\n \nalter table if exists OpJobDefinition \n \ add constraint FKmjg16wiu5c330j6mntdyovvf7 \n foreign key (RuntimeId) \n references OpRuntime;\n \nalter table if exists OpJobDefinition \n add constraint FK6q9s91u88wokobh9tusv5655d \n foreign key (JobDefinitionGroupId) \n references OpJobDefinition;\n \nalter table if exists OpJobDefinition \n add constraint FKnfxldt2fyaoj877hpjobvovfl \n foreign key (SuccessNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpJobDefinition \n add constraint FK4vybvi3jvkm6usnxu789txwao \n foreign key (WarningNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpJobDefinition \n add constraint FKj6bencvu7xqur6501xshhrs55 \n foreign key (ErrorNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpJobDefinitionAction \n add constraint FKaicpaly3wmew35gu3qxxtdpn5 \n foreign key (JobDefinitionId) \n references OpJobDefinition;\n \nalter table if exists OpJobDefinitionActionArgument \n add constraint FK1j1mmr7nlakd24hg4i3dpq1u7 \n foreign key (JobDefinitionActionId) \n references OpJobDefinitionAction;\n \nalter table if exists OpJobDefinitionDependency \n add constraint FKd9fimu675rh94yo0fxmmavrgc \n foreign key (JobDefinitionId) \n references OpJobDefinition;\n \nalter table if exists OpJobDefinitionPropertyValue \n add constraint FKpo8nop1ypy9fhuvshrs9asbm4 \n foreign key (JobDefinitionId) \n references OpJobDefinition;\n \nalter table if exists OpJobDefinitionPropertyValue \n add constraint FK6k3bf9fx2s1fcgb2wrlgs1y0t \n foreign key (PropertyTypeId) \n references OpPropertyType;\n \nalter table if exists OpJobEvent \n add constraint FK46o9dp9a3lnttt11pa37ho2ay \n foreign key (JobId) \n references OpJob;\n \nalter table if exists OpJobPropertyValue \n add constraint FK1ebxtnscc18dmvkmtfel4cf8y \n foreign key (JobId) \n references OpJob;\n \nalter table if exists OpJobPropertyValue \n add constraint FKdntbqa4i4wncug5qwye4c345l \n foreign key (PropertyTypeId) \n references OpPropertyType;\n \nalter table if exists OpKeyFile \n add constraint FK4w9i06ubaolelk4cgoejlnsi9 \n foreign key (KeyId) \n references OpKey;\n \nalter table if exists OpKeyServerReport \n add constraint FK2xrnkcbm7714ysx1qwx304myy \n foreign key (ProductId) \n references OpProduct;\n \nalter table if exists OpMetric \n add constraint FKb28q210jlj42tbswaxt6stk4c \n foreign key (ExecutableId) \n \ references OpExecutable;\n \nalter table if exists OpMetric \n add constraint FKnbgnqfw3e7qapn21bhjx4cy3t \n foreign key (EmeExecutableId) \n references OpEmeExecutable;\n \nalter table if exists OpMetricValue \n \ add constraint FKmmiurng5qel6n6v8wiueehnaf \n foreign key (JobId) \n references OpJob;\n \nalter table if exists OpMetricValue \n add constraint FKli9jusdh24vepx5l0nglmgn6a \n foreign key (MetricId) \n references OpMetric;\n \nalter table if exists OpMetricValue \n add constraint FKslcmi9t763y8l5es34qe7k4eo \n foreign key (KeyId) \n references OpKey;\n \nalter table if exists OpMetricValue \n add constraint FK1ty7451rfhcsag9v0nesb22nf \n foreign key (ApplicationId) \n references OpApplication;\n \nalter table if exists OpMetricValue \n add constraint FK8y27w9d7x359k7cnwtlfy0yj7 \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpMetricValue \n add constraint FKivvhfj1nvmxdoxd3apsdvj2x0 \n foreign key (ExecutableId) \n references OpExecutable;\n \nalter table if exists OpMonitoredEvent \n \ add constraint FK70yshhxuf8jnjc2gi9vlcr5uk \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpMonitoredEvent \n add constraint FK4d28knr51jhkh2l5jfn1i6kg8 \n foreign key (ReporterId) \n references OpReporter;\n \nalter table if exists OpMonitoredEvent \n add constraint FKkf3i7vdebueiqk41idsrsn4e0 \n foreign key (ProductId) \n references OpProduct;\n \nalter table if exists OpMonitoredEvent \n add constraint FKh21l4ot9lyfor6uq3yv45v772 \n foreign key (HostId) \n references OpHost;\n \nalter table if exists OpMonitoredStatus \n add constraint FK8c31p3qvnq7ti7fds43ca6gii \n foreign key (LastEventId) \n references OpMonitoredEvent;\n \nalter table if exists OpMonitoredStatus \n add constraint FKq1rgfe82j85asdsw5b50h7n4w \n foreign key (SeverestEventId) \n references OpMonitoredEvent;\n \nalter table if exists OpMonitoredStatus \n add constraint FKnehhcev0cbdn84wi8pp676axw \n foreign key (HostId) \n references OpHost;\n \nalter table if exists OpMonitoredStatus \n add constraint FKrrybo9f78euqjmh7yl2ss0w6l \n foreign key (ProductId) \n references OpProduct;\n \nalter table if exists OpMonitoredStatus \n add constraint FKteg48m6ky3wkdc1cp2ivvs2bc \n foreign key (ReporterId) \n references OpReporter;\n \nalter table if exists OpMonitoredStatus \n \ add constraint FKf4go69un31nj25swrwsgr4qrg \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpNotificationGroupRecipient \n add constraint FK4185w3mulcvyewr3layxajfq1 \n foreign key (RecipientId) \n references OpRecipient;\n \nalter table if exists OpNotificationGroupRecipient \n add constraint FK7l4kih5xn6c0g33nrr5k808sa \n foreign key (NotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpOSAuthentication \n add constraint FKkhrotlmhsuawhb64jvglgkwxa \n foreign key (HostId) \n references OpHost;\n \nalter table if exists OpPrivilege \n add constraint FKiimwxq78w88nmjfr9bung2o2d \n foreign key (PrincipalId) \n references OpPrincipal;\n \nalter table if exists OpPrivilege \n add constraint FK7yjy1dq3pxdbgqxak8b9tm4j2 \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpProduct \n add constraint FKsmpiwa7pwrlmoaf6yn4p8innp \n foreign key (ProductTypeId) \n references OpProductType;\n \nalter table if exists OpProduct \n add constraint FKo152j20ftrguq9kd6t58eoycd \n foreign key (HostId) \n references OpHost;\n \nalter table if exists OpProduct \n \ add constraint FK14ja326m0vi6bsdwxhe7lfhok \n foreign key (WarningNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpProduct \n \ add constraint FKhrphhg40gqdukkwn3bmnbvbkx \n foreign key (ErrorNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpProduct \n \ add constraint FKq48qupxdp2rk0gslh7h9s6g5s \n foreign key (FatalNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpProductXref \n add constraint FK4ij6847j66o3uekjkrlyxqw3y \n foreign key (LeftProductId) \n references OpProduct;\n \nalter table if exists OpProductXref \n add constraint FK2huotylket4dff0ja7g8irayc \n foreign key (RightProductId) \n \ references OpProduct;\n \nalter table if exists OpPropertyType \n add constraint FKpb7ap21sodo2uxnmoawh16sqo \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpQueue \n add constraint FK6q02htq4sfo3sn2rsejamvebt \n foreign key (HostId) \n references OpHost;\n \nalter table if exists OpQueue \n add constraint FKqv232547og7vbih7alhdjtkvw \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpQueue \n \ add constraint FKes8fkpy2peo54oht7eag4wdu7 \n foreign key (WarningNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpQueue \n \ add constraint FKdomo5ght0xr5d2honmvvxipog \n foreign key (ErrorNotificationGroupId) \n references OpNotificationGroup;\n \nalter table if exists OpQueueClient \n add constraint FK3gybwnrpp0sm8489hr5ew7j8f \n foreign key (QueueId) \n references OpQueue;\n \nalter table if exists OpQueueClient \n add constraint FKgl0qsapws57gk4yvy8o6e3w8u \n foreign key (QueueSubscriberId) \n references OpQueueSubscriber;\n \nalter table if exists OpQueueClient \n add constraint FKp4fdvgf5wrmqy465ptpp3bwr7 \n foreign key (JobId) \n references OpJob;\n \nalter table if exists OpQueueMetric \n add constraint FKohtmlnaw1hltr3bknh8y15wdx \n foreign key (QueueId) \n references OpQueue;\n \nalter table if exists OpQueueMetric \n add constraint FK4ghmtqvwvdm4kt2hbe5c0eqso \n foreign key (QueueSubscriberId) \n references OpQueueSubscriber;\n \nalter table if exists OpQueueMetricValue \n add constraint FK99m0tb4fhl9fi8ohrj19bj45m \n foreign key (QueueMetricId) \n references OpQueueMetric;\n \nalter table if exists OpQueueStats \n add constraint FKdh147844yh1k6gqat0yd30i2k \n foreign key (QueueId) \n references OpQueue;\n \nalter table if exists OpQueueSubscriber \n add constraint FKk9wjbkpcr28yfdyrenpgxak4d \n \ foreign key (QueueId) \n references OpQueue;\n \nalter table if exists OpRecipientHeader \n add constraint FKekn0l0d44xmo3lbbenmn5skbq \n foreign key (RecipientId) \n references OpRecipient;\n \nalter table if exists OpReporter \n add constraint FKptip1tkucm4efk0veuu4ygm6j \n foreign key (PhysicalHostId) \n references OpHost;\n \nalter table if exists OpReporter \n add constraint FKinynsh2b4q88emwciwb4i0akq \n foreign key (ProductId) \n references OpProduct;\n \nalter table if exists OpReporter \n add constraint FK6bfovefxv4cllw6hy6mq1v263 \n foreign key (LogicalHostId) \n references OpHost;\n \nalter table if exists OpReporter \n add constraint FKs1k4765v2piti3iu3h2oks7e9 \n foreign key (ReporterConfigSetId) \n references OpReporterConfigSet;\n \nalter table if exists OpReporterConfigItem \n add constraint FKdyi1q8bnvo8yjmbk4eqah7gvo \n foreign key (ReporterDefaultConfigItemId) \n references OpReporterDefaultConfigItem;\n \nalter table if exists OpReporterConfigItem \n add constraint FKfn2lk24trdsp8yycppk9hlki5 \n foreign key (ReporterConfigSetId) \n references OpReporterConfigSet;\n \nalter table if exists OpReporterDirectory \n add constraint FKbolhvku7wt6s93tt7y8wgkgho \n foreign key (ReporterId) \n references OpReporter;\n \nalter table if exists OpResourcePart \n add constraint FK4ih4eaxqodwau0bt2pk6d43s1 \n \ foreign key (ResourceRequestId) \n references OpResourceRequest;\n \nalter table if exists OpResourcePart \n add constraint FKc1uvg9eqvbw9x89jnqyfwmtb1 \n foreign key (ResourceSettingId) \n references OpResourceSetting;\n \nalter table if exists OpResourcePool \n add constraint FKa1reo39pgvs37qvaalkdmdtnd \n foreign key (ResourceServerId) \n references OpResourceServer;\n \nalter table if exists OpResourceRequest \n add constraint FKndw95jdnv9aaipau7pnf8wu64 \n foreign key (ResourceServerId) \n references OpResourceServer;\n \nalter table if exists OpResourceServer \n add constraint FKr6j8gtqxndq6ba24v5nq1v3cr \n foreign key (ProductId) \n references OpProduct;\n \nalter table if exists OpResourceSetting \n add constraint FK2v4dt3hkpe4gyweqeuyojd0cu \n foreign key (ResourcePoolId) \n references OpResourcePool;\n \nalter table if exists OpRuntime \n add constraint FKh9j023pv4vhjkdq6f7ohhm5c4 \n foreign key (OSAuthenticationId) \n references OpOSAuthentication;\n \nalter table if exists OpRuntime \n add constraint FK91f6p6or4iiv0ay5ldbot20ju \n foreign key (BridgeId) \n references OpBridge;\n \nalter table if exists OpRuntime \n add constraint FK79o2xoov16babuwujmp6ks11j \n foreign key (SystemId) \n references OpSystem;\n \nalter table if exists OpRuntime \n add constraint FK41qhxbe96r0y8ua8vgiltbjug \n foreign key (SchedulingHostId) \n references OpHost;\n \nalter table if exists OpTimeConstraint \n add constraint FK9n4in5nmm36xytda9ukxilj88 \n foreign key (JobDefinitionId) \n references OpJobDefinition;\n \nalter table if exists OpTimeConstraint \n add constraint FKfkvdlbhber0as1joi8hgwh58y \n foreign key (CalendarId) \n references OpCalendar;\n \nalter table if exists OpZMVDenormalizedDay \n add constraint FKs0tp2h8l8i44pvw97p6ttco6c \n foreign key (JobId) \n references OpJob;\n \nalter table if exists OpZMVDenormalizedDay \n add constraint FKdt1m9cg6s92phsk2swa72itn6 \n foreign key (ApplicationId) \n \ references OpApplication;\n \nalter table if exists OpZMVDenormalizedDay \n add constraint FKav0n3tidhacdc7l0l1ee0nmex \n foreign key (ExecutableId) \n references OpExecutable;\n \nalter table if exists OpZMVDenormalizedDay \n add constraint FK2d3xu46hrjn5v8oy4rrip9onu \n foreign key (KeyId) \n references OpKey;\n \nalter table if exists OpZMVDenormalizedDay \n add constraint FKsgsnnswtmgmc3k1gsfrcu7o5k \n foreign key (MetricId) \n references OpMetric;\n \nalter table if exists OpZMVDifference \n add constraint FK44536lkj3y99mqt7vqk8u9sw9 \n foreign key (JobId) \n references OpJob;\n \nalter table if exists OpZMVDifference \n add constraint FK2l9lnao4dop8ftqq8483dw8vf \n foreign key (ApplicationId) \n references OpApplication;\n \nalter table if exists OpZMVDifference \n add constraint FK3hetm17drihbsk82b3n4rrbmk \n foreign key (ExecutableId) \n references OpExecutable;\n \nalter table if exists OpZMVDifference \n add constraint FKm24ly70d5dnv1547ba45lx0kh \n foreign key (KeyId) \n references OpKey;\n \nalter table if exists OpZMVDifference \n add constraint FKpboia9fdjshagewo4xbydpwk0 \n foreign key (MetricId) \n references OpMetric;\n-- create indexes\n--start-script\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_app_warnnotifygrpid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opapplication'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_APP_WARNNOTIFYGRPID ON OpApplication (WarningNotificationGroupId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_app_errornotifygrpid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opapplication'\n and idx.indrelid = tbl.oid\n \ and idx.indisunique != 't'\n and idx.indisprimary != 't');\n \ if (cnt = 0) then\n execute E'CREATE INDEX IDX_APP_ERRORNOTIFYGRPID ON OpApplication (ErrorNotificationGroupId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_audit_updatestamp'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opaudit'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_AUDIT_UPDATESTAMP ON OpAudit (UpdateStamp)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_bridge_hostid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opbridge'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_BRIDGE_HOSTID ON OpBridge (HostId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_osauthentication_hostid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'oposauthentication'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_OSAUTHENTICATION_HOSTID ON OpOSAuthentication (HostId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_runtime_osauthenticationid'\n and relkind = 'i'\n and oid in (\n \ select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opruntime'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_RUNTIME_OSAUTHENTICATIONID ON OpRuntime (OSAuthenticationId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_runtime_bridgeid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opruntime'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_RUNTIME_BRIDGEID ON OpRuntime (BridgeId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_host_physicalhostid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'ophost'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_HOST_PHYSICALHOSTID ON OpHost (PhysicalHostId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_fsmv_colltime'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opfilesystemmetricvalue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_FSMV_COLLTIME ON OpFileSystemMetricValue (CollectionTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_host_mv_colltime'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'ophostmetricvalue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_HOST_MV_COLLTIME ON OpHostMetricValue (CollectionTime)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_jhr_label'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjamonhourlyreport'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JHR_LABEL ON OpJamonHourlyReport (Label)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_jhr_nodeidentifier'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjamonhourlyreport'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JHR_NODEIDENTIFIER ON OpJamonHourlyReport (NodeIdentifier)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_jhr_lni'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjamonhourlyreport'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JHR_LNI ON OpJamonHourlyReport (Label, NodeIdentifier)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_jpr_label'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjamonpfsreport'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JPR_LABEL ON OpJamonPFSReport (Label)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_jpr_nodeidentifier'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjamonpfsreport'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JPR_NODEIDENTIFIER ON OpJamonPFSReport (NodeIdentifier)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_executable_hostname'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opexecutable'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_EXECUTABLE_HOSTNAME ON OpExecutable (Hostname)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_executable_prototype'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opexecutable'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_EXECUTABLE_PROTOTYPE ON OpExecutable (PrototypeExecutableId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_metricval_jobidctime'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_METRICVAL_JOBIDCTIME ON OpMetricValue (JobId, CollectionTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_metricval_midsummctime'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_METRICVAL_MIDSUMMCTIME ON OpMetricValue (MetricId, IsSummary, CollectionTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_metricval_midsummval'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_METRICVAL_MIDSUMMVAL ON OpMetricValue (MetricId, IsSummary, Value)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_metricvalue_metricid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_METRICVALUE_METRICID ON OpMetricValue (MetricId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_mv_jgaeseisctsshhmm'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MV_JGAESEISCTSSHHMM ON OpMetricValue (JobDefinitionGuid, ActionEnum, StateEnum, MetricId, IsSummary, CollectionTime, ScheduledStartTimeHHMM)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_mv_midsumexecoljidjgv'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MV_MIDSUMEXECOLJIDJGV ON OpMetricValue (MetricId, IsSummary, ExecutableId, CollectionTime, JobId, JobGuid, Value)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_mv_jgaesemidisctjgvsstjid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MV_JGAESEMIDISCTJGVSSTJID ON OpMetricValue (JobDefinitionGuid, ActionEnum, StateEnum, MetricId, IsSummary, CollectionTime, JobGuid, Value, ScheduledStartTime, JobId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_mv_jdgeisemiisctssthhmm'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MV_JDGEISEMIISCTSSTHHMM ON OpMetricValue (JobDefinitionGuid, ExecutableId, StateEnum, MetricId, IsSummary, CollectionTime, ScheduledStartTimeHHMM, ScheduledStartTime, JobId, JobGuid, Value)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_mv_bucket'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n and idx.indrelid = tbl.oid\n \ and idx.indisunique != 't'\n and idx.indisprimary != 't');\n \ if (cnt = 0) then\n execute E'CREATE INDEX IDX_MV_BUCKET ON OpMetricValue (Bucket)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_mv_keyid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmetricvalue'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MV_KEYID ON OpMetricValue (KeyId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_toplevel_effshdstart'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_TOPLEVEL_EFFSHDSTART ON OpJob (ParentJobId, RerunSuccessorJobId, IsSupportsDependencies, EffectiveScheduledStartTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_toplevel_stateendtime'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_TOPLEVEL_STATEENDTIME ON OpJob (ParentJobId, RerunSuccessorJobId, IsSupportsDependencies, StateEnum, EndTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_derived_name'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_DERIVED_NAME ON OpJob (DerivedName)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_eff_scheduled_start_time'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_EFF_SCHEDULED_START_TIME ON OpJob (EffectiveScheduledStartTime)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_job_end_start_abworkdir'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_END_START_ABWORKDIR ON OpJob (EndTime, StartTime, AbWorkDir)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_executableid'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_EXECUTABLEID ON OpJob (ExecutableId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_job_exeidendtime'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_EXEIDENDTIME ON OpJob (ExecutableId, EndTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_exestatestartend'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_EXESTATESTARTEND ON OpJob (ExecutableId, StateEnum, StartTime, EndTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_exeschedstartend'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_EXESCHEDSTARTEND ON OpJob (ExecutableId, ScheduledStartTime, StartTime, EndTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_job_jobdefinitionid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_JOBDEFINITIONID ON OpJob (JobDefinitionId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_jobenum_estart_etime'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_JOBENUM_ESTART_ETIME ON OpJob (JobEnum, EffectiveScheduledStartTime, EndTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_parent_job_id'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_PARENT_JOB_ID ON OpJob (ParentJobId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_appvwprjb_vwendstart'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_APPVWPRJB_VWENDSTART ON OpJob (ApplicationId, ViewParentJobId, ViewEnd, ViewStart)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_hstvwprjb_vwendstart'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_HSTVWPRJB_VWENDSTART ON OpJob (ResolvedHostname, ViewParentJobId, ViewEnd, ViewStart)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_parrrsuccetypestart'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_PARRRSUCCETYPESTART ON OpJob (ParentJobId, RerunSuccessorJobId, JobEnum, EffectiveScheduledStartTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_rerunpredecessorjobid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n \ and idx.indisunique != 't'\n and idx.indisprimary != 't');\n \ if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_RERUNPREDECESSORJOBID ON OpJob (RerunPredecessorJobId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_rerunsuccessorjobid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n \ where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_RERUNSUCCESSORJOBID ON OpJob (RerunSuccessorJobId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_scheduled_start_time'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_SCHEDULED_START_TIME ON OpJob (ScheduledStartTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_severest_event_guid'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_SEVEREST_EVENT_GUID ON OpJob (SeverestEventGuid)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_job_vwparjob_viewendstart'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_VWPARJOB_VIEWENDSTART ON OpJob (ViewParentJobId, ViewEnd, ViewStart)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_vwparjob_viewstart'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_VWPARJOB_VIEWSTART ON OpJob (ViewParentJobId, ViewStart)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_starttime'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_STARTTIME ON OpJob (StartTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_stateenum'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n \ and idx.indisunique != 't'\n and idx.indisprimary != 't');\n \ if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_STATEENUM ON OpJob (StateEnum)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_job_vmid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n \ and idx.indisunique != 't'\n and idx.indisprimary != 't');\n \ if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_VMID ON OpJob (Vmid)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_job_rerun'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n \ and idx.indisunique != 't'\n and idx.indisprimary != 't');\n \ if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_RERUN ON OpJob (RerunGuid, EndTime, StateEnum)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_reparent'\n and relkind = 'i'\n and oid in (\n \ select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_REPARENT ON OpJob (JobDefinitionId, ViewParentJobId, StateEnum, IsIssuesIgnored, ViewEnd)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_job_testsetguid'\n and relkind = 'i'\n and oid in (\n \ select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjob'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOB_TESTSETGUID ON OpJob (TestSetGuid)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_jobevent_jobid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjobevent'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOBEVENT_JOBID ON OpJobEvent (JobId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_jobcompletion_endtime'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjobcompletion'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOBCOMPLETION_ENDTIME ON OpJobCompletion (EndTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_jobcompletion_updatestamp'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjobcompletion'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOBCOMPLETION_UPDATESTAMP ON OpJobCompletion (UpdateStamp)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monev_mguidevt'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredevent'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONEV_MGUIDEVT ON OpMonitoredEvent (MonitoredObjectGuid, EventTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monev_mguilifevt'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredevent'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONEV_MGUILIFEVT ON OpMonitoredEvent (MonitoredObjectGuid, LifecycleState, EventTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monev_evt'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredevent'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONEV_EVT ON OpMonitoredEvent (EventTime)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monev_hostid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredevent'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONEV_HOSTID ON OpMonitoredEvent (HostId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_monev_reporterid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredevent'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONEV_REPORTERID ON OpMonitoredEvent (ReporterId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monev_productid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredevent'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONEV_PRODUCTID ON OpMonitoredEvent (ProductId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_monev_systemid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredevent'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONEV_SYSTEMID ON OpMonitoredEvent (SystemId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monev_errorcode'\n and relkind = 'i'\n and oid in (\n \ select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredevent'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONEV_ERRORCODE ON OpMonitoredEvent (ErrorCode)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_monst_hostid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredstatus'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONST_HOSTID ON OpMonitoredStatus (HostId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monst_reporterid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredstatus'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONST_REPORTERID ON OpMonitoredStatus (ReporterId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_monst_productid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredstatus'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONST_PRODUCTID ON OpMonitoredStatus (ProductId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monst_systemid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredstatus'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONST_SYSTEMID ON OpMonitoredStatus (SystemId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_monst_sevevtid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredstatus'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONST_SEVEVTID ON OpMonitoredStatus (SeverestEventId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_monst_lastevtid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opmonitoredstatus'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_MONST_LASTEVTID ON OpMonitoredStatus (LastEventId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_product_hostid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opproduct'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_PRODUCT_HOSTID ON OpProduct (HostId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_queue_systemid'\n and relkind = 'i'\n and oid in (\n \ select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opqueue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUE_SYSTEMID ON OpQueue (SystemId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_queue_warnnotifygrpid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opqueue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUE_WARNNOTIFYGRPID ON OpQueue (WarningNotificationGroupId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_queue_errornotifygrpid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n \ where tbl.relname = 'opqueue'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUE_ERRORNOTIFYGRPID ON OpQueue (ErrorNotificationGroupId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_queueclient_queueid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opqueueclient'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUECLIENT_QUEUEID ON OpQueueClient (QueueId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_queueclient_subsid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opqueueclient'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUECLIENT_SUBSID ON OpQueueClient (QueueSubscriberId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_queueclient_jobid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opqueueclient'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUECLIENT_JOBID ON OpQueueClient (JobId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_queuesubs_queueid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opqueuesubscriber'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUESUBS_QUEUEID ON OpQueueSubscriber (QueueId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_queuemetric_queueid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opqueuemetric'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUEMETRIC_QUEUEID ON OpQueueMetric (QueueId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_queuemetric_subsid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opqueuemetric'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_QUEUEMETRIC_SUBSID ON OpQueueMetric (QueueSubscriberId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_rspool_rsserver'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opresourcepool'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_RSPOOL_RSSERVER ON OpResourcePool (ResourceServerId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_rs_product'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opresourceserver'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_RS_PRODUCT ON OpResourceServer (ProductId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_rssetting_rspool'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opresourcesetting'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_RSSETTING_RSPOOL ON OpResourceSetting (ResourcePoolId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_rsrequest_rsserver'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opresourcerequest'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_RSREQUEST_RSSERVER ON OpResourceRequest (ResourceServerId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_rspart_rsrequest'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opresourcepart'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_RSPART_RSREQUEST ON OpResourcePart (ResourceRequestId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_rspart_rssetting'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opresourcepart'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_RSPART_RSSETTING ON OpResourcePart (ResourceSettingId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_jobdef_name'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjobdefinition'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOBDEF_NAME ON OpJobDefinition (Name)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_jobdef_application'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjobdefinition'\n \ and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOBDEF_APPLICATION ON OpJobDefinition (ApplicationId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_jobdef_runtime'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjobdefinition'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOBDEF_RUNTIME ON OpJobDefinition (RuntimeId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_jobdef_jobdefgrp'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjobdefinition'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOBDEF_JOBDEFGRP ON OpJobDefinition (JobDefinitionGroupId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_jobdef_discrimeffsstime'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n \ where tbl.relname = 'opjobdefinition'\n and idx.indrelid = tbl.oid\n \ and idx.indisunique != 't'\n and idx.indisprimary != 't');\n \ if (cnt = 0) then\n execute E'CREATE INDEX IDX_JOBDEF_DISCRIMEFFSSTIME ON OpJobDefinition (JobDefinitionDiscriminator, EffectiveScheduledStartTime)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_feconstraint_jdid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opfileandeventconstraint'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_FECONSTRAINT_JDID ON OpFileAndEventConstraint (JobDefinitionId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_filebatch_property_type'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opfileandeventconstraint'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_FILEBATCH_PROPERTY_TYPE ON OpFileAndEventConstraint (PropertyTypeId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_timeconstraint_calendarid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'optimeconstraint'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_TIMECONSTRAINT_CALENDARID ON OpTimeConstraint (CalendarId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_jdaction_jdid'\n and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opjobdefinitionaction'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_JDACTION_JDID ON OpJobDefinitionAction (JobDefinitionId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from pg_class where relname = 'idx_groupxref_parentgroupid'\n \ and relkind = 'i'\n and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opgroupxref'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_GROUPXREF_PARENTGROUPID ON OpGroupXref (ParentGroupId)';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from pg_class where relname = 'idx_privilege_systemid'\n and relkind = 'i'\n \ and oid in (\n select indexrelid from pg_index idx, pg_class tbl\n where tbl.relname = 'opprivilege'\n and idx.indrelid = tbl.oid\n and idx.indisunique != 't'\n and idx.indisprimary != 't');\n if (cnt = 0) then\n execute E'CREATE INDEX IDX_PRIVILEGE_SYSTEMID ON OpPrivilege (SystemId)';\n \ end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\n--end-script\n-- populate database with default data\n--start-script\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpSystem (SystemId, SystemGuid, Name, Description, UpdateStamp, ProductionDayHHMM, TimeZoneId, ExcludeJobColumns, ExcludeJobDefinitionColumns , IsAutoGenEnabled, AutoGenRangeMins, AutoGenOffsetMins, AutoGenDailyFrequency, MarkForDelete) values (nextval(''hibernate_sequence''), ''sys:DEFAULT:20250502114954'', ''DEFAULT'', ''Default system'', to_timestamp(''1970-01-01 00:00:00.000'', ''YYYY-MM-DD HH24:MI:SS.MS''), ''00:00'', ''UTC'', ''End,Host Cluster,Job Definition,Job Definition Group,Job GUID'','''' , ''Y'', 1440, 30, 1, ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpApplication (ApplicationId, SystemId, Name, Description, IsApplicationNeverAutoGen) select nextval(''hibernate_sequence''), \ SystemId, ''DEFAULT'', ''Default Application'', ''N'' from OpSystem where Name = ''DEFAULT''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'insert into OpAutoGenStats (AutoGenStatsId, SystemId) select nextval(''hibernate_sequence''), \ SystemId from OpSystem';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpMonitoredStatus (MonitoredStatusId, StatusTypeDiscriminator, SystemId) select nextval(''hibernate_sequence''), ''SYSTEM'', s.SystemId from OpSystem s left outer join OpMonitoredStatus oms on s.SystemId = oms.SystemId \ where oms.SystemId is null';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPropertyType (PropertyTypeId, PropertyTypeDiscriminator, SystemId, Name, Description, ColumnSequence, CustomTypeEnum) select nextval(''hibernate_sequence''), \ ''CUSTOM'', SystemId, ''PROCESS_REGION'', ''Region'', 10, ''STRING'' from OpSystem where Name = ''DEFAULT''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPropertyType (PropertyTypeId, PropertyTypeDiscriminator, SystemId, Name, Description, ColumnSequence, DefaultValue, BuiltinPropertyExpression) select nextval(''hibernate_sequence''), ''BUILTIN'', SystemId, ''BOOK_DATE'', ''Book Date'', 60, ''Unknown Book Date'', ''timeConstraint.calendar.bookDate'' from OpSystem where Name = ''DEFAULT''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpJobSet (JobSetId, UpdateStamp, JobSetGuid, Name, IsMonitored, SystemId, GroupByName, BadStatusTypeEnum, IssuesSeverityOrderEnum, OrderByName, IsOrderAscending, IsShowOrderByLabel, JobMax) select nextval(''hibernate_sequence''), current_timestamp at time zone ''UTC'', ''JobSet.'' || SystemGuid, ''All jobs in '' || Name, \ ''Y'', SystemId, ''Application'', ''FAILED_JOBS'', ''ALL_ACTUAL_HIGHER'', ''Start'', ''N'', ''Y'', 0 from OpSystem ';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpQuickLink (QuickLinkId, Name, Description, Url, IconName, IsHidden, Sequence) values (nextval(''hibernate_sequence''), '''', ''Last Viewed Queues'', ''area=jobs&silo=system&subarea=queues'', ''ViewQueues'', ''N'', 0)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpQuickLink (QuickLinkId, Name, Description, Url, IconName, IsHidden, Sequence) values (nextval(''hibernate_sequence''), '''', ''Last Viewed Resources'', ''area=jobs&silo=system&subarea=resources'', ''ViewResources'', ''N'', 1)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpQuickLink (QuickLinkId, Name, Description, Url, IconName, IsHidden, Sequence) values (nextval(''hibernate_sequence''), '''', ''Last Viewed Schedule'', ''area=jobs&silo=system&subarea=schedule'', ''ViewSchedule'', ''N'', 2)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'DELETE FROM OpAnalysisRowSQL';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'DELETE FROM OpAnalysisAggregatorSQL';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'DELETE FROM OpAnalysisRow';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'DELETE FROM OpAnalysisAggregator';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'DELETE FROM OpAnalysisObject';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisObject (AnalysisObjectId, Name, TableName, BucketSQL) VALUES (nextval(''hibernate_sequence''), ''Jobs'', ''OpMetricValue'', ''OpMetricValue.Bucket'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''System'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Host'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Application'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''User'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Executable'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Type'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''WorkingDirectory'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''AB_WORK_DIR'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''AB_HOME'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''JobDefinition'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''System''), ''OpSystem'', ''SystemId'', ''OpMetricValue'', ''SystemId'', ''LEFT OUTER JOIN'', ''COALESCE(OpSystem.Name, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''Host''), ''OpExecutable'', ''ExecutableId'', ''OpMetricValue'', ''ExecutableId'', ''LEFT OUTER JOIN'', ''COALESCE(OpMetricValue.Hostname, OpExecutable.Hostname, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''Application''), ''OpApplication'', ''ApplicationId'', ''OpMetricValue'', ''ApplicationId'', ''LEFT OUTER JOIN'', ''COALESCE(OpApplication.Name, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''User''), ''OpJob'', ''JobId'', ''OpMetricValue'', ''JobId'', ''LEFT OUTER JOIN'', ''COALESCE(OpJob.Username, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''Executable''), ''OpExecutable'', ''ExecutableId'', ''OpMetricValue'', ''ExecutableId'', ''LEFT OUTER JOIN'', ''COALESCE(OpExecutable.ExpandedPath, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''Type''), ''OpExecutable'', ''ExecutableId'', ''OpMetricValue'', ''ExecutableId'', ''LEFT OUTER JOIN'', ''COALESCE(OpExecutable.ExecutableEnum, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''WorkingDirectory''), ''OpJob'', ''JobId'', ''OpMetricValue'', ''JobId'', ''LEFT OUTER JOIN'', ''COALESCE(OpJob.WorkingDirectory, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''AB_WORK_DIR''), ''OpJob'', ''JobId'', ''OpMetricValue'', ''JobId'', ''LEFT OUTER JOIN'', ''COALESCE(OpJob.AbWorkDir, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''AB_HOME''), ''OpJob'', ''JobId'', ''OpMetricValue'', ''JobId'', ''LEFT OUTER JOIN'', ''COALESCE(OpJob.AbHome, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''JobDefinition''), ''OpJob'', ''JobId'', ''OpMetricValue'', ''JobId'', ''LEFT OUTER JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisRow.Name = ''JobDefinition''), ''OpJobDefinition'', ''JobDefinitionId'', ''OpJob'', ''JobDefinitionId'', ''LEFT OUTER JOIN'', ''COALESCE(OpJobDefinition.Name, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Startup CPU'', ''Startup CPU'', ''seconds'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''System CPU'', ''System CPU'', ''seconds'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Total CPU'', ''Total CPU'', ''seconds'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Total read'', ''Total read'', ''kilobytes'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Total read, records'', ''Total read, records'', ''records'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Total rejected'', ''Total rejected'', ''records'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Total written'', ''Total written'', ''kilobytes'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Total written, records'', ''Total written, records'', ''records'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''User CPU'', ''User CPU'', ''seconds'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Jobs''), ''Job Count'', ''Job Count'', ''count'', ''SUM'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''Startup CPU''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''System CPU''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''Total CPU''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''Total read''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''Total read, records''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''Total rejected''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''Total written''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''Total written, records''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''User CPU''), ''OpMetric'', ''MetricId'', ''OpMetricValue'', ''MetricId'', ''JOIN'', ''SUM(OpMetricValue.Value)'', ''OpMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Jobs'' AND OpAnalysisAggregator.Name = ''Job Count''), ''OpJob'', ''JobId'', ''OpMetricValue'', ''JobId'', ''JOIN'', ''COUNT(DISTINCT OpMetricValue.JobId)'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisObject (AnalysisObjectId, Name, TableName, BucketSQL) VALUES (nextval(''hibernate_sequence''), ''Hosts'', ''OpHostMetricValue'', ''BUCKET OpHostMetricValue.CollectionTime'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''Hostname'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''Category'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''OperatingSystem'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisRow.Name = ''Hostname''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisRow.Name = ''Hostname''), ''OpHost'', ''HostId'', ''OpHostMetric'', ''HostId'', ''JOIN'', ''COALESCE(OpHost.Hostname, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisRow.Name = ''Category''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisRow.Name = ''Category''), ''OpHost'', ''HostId'', ''OpHostMetric'', ''HostId'', ''JOIN'', ''COALESCE(OpHost.Tag, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisRow.Name = ''OperatingSystem''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisRow.Name = ''OperatingSystem''), ''OpHost'', ''HostId'', ''OpHostMetric'', ''HostId'', ''JOIN'', ''COALESCE(OpHost.OperatingSystem, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuTotalUsage'', ''Average Total CPU'', ''percent'', ''AVG'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageIdle'', ''Average Idle CPU'', ''percent'', ''AVG'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageSystem'', ''Average System CPU'', ''percent'', ''AVG'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageUser'', ''Average User CPU'', ''percent'', ''AVG'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuTotalUsage'', ''Max Total CPU'', ''percent'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageIdle'', ''Max Idle CPU'', ''percent'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageSystem'', ''Max System CPU'', ''percent'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageUser'', ''Max User CPU'', ''percent'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuTotalUsage'', ''Min Total CPU'', ''percent'', ''MIN'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageIdle'', ''Min Idle CPU'', ''percent'', ''MIN'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageSystem'', ''Min System CPU'', ''percent'', ''MIN'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Hosts''), ''cpuUsageUser'', ''Min User CPU'', ''percent'', ''MIN'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Average Total CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''AVG(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Average Idle CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''AVG(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Average System CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''AVG(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Average User CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''AVG(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Max Total CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''MAX(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Max Idle CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''MAX(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Max System CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''MAX(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Max User CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''MAX(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Min Total CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''MIN(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Min Idle CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''MIN(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Min System CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''MIN(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Hosts'' AND OpAnalysisAggregator.Name = ''Min User CPU''), ''OpHostMetric'', ''HostMetricId'', ''OpHostMetricValue'', ''HostMetricId'', ''JOIN'', ''MIN(OpHostMetricValue.Value)'', ''OpHostMetric.Name'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisObject (AnalysisObjectId, Name, TableName, BucketSQL) VALUES (nextval(''hibernate_sequence''), ''Queues'', ''OpQueueMetricValue'', ''BUCKET OpQueueMetricValue.CollectionTime'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''QueueName'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''Host'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''System'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''Directory'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''Type'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''Owner'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRow (AnalysisRowId, AnalysisObjectId, Name) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''Version'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''QueueName''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''LEFT OUTER JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''QueueName''), ''OpQueue'', ''QueueId'', ''OpQueueMetric'', ''QueueId'', ''JOIN'', ''COALESCE(OpQueue.Name, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Host''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''LEFT OUTER JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Host''), ''OpQueue'', ''QueueId'', ''OpQueueMetric'', ''QueueId'', ''JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Host''), ''OpHost'', ''HostId'', ''OpQueue'', ''HostId'', ''JOIN'', ''COALESCE(OpHost.Hostname, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''System''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''LEFT OUTER JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''System''), ''OpQueue'', ''QueueId'', ''OpQueueMetric'', ''QueueId'', ''JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''System''), ''OpSystem'', ''SystemId'', ''OpQueue'', ''SystemId'', ''JOIN'', ''COALESCE(OpSystem.Name, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Directory''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''LEFT OUTER JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Directory''), ''OpQueue'', ''QueueId'', ''OpQueueMetric'', ''QueueId'', ''JOIN'', ''COALESCE(OpQueue.Directory, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Type''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''LEFT OUTER JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Type''), ''OpQueue'', ''QueueId'', ''OpQueueMetric'', ''QueueId'', ''JOIN'', ''COALESCE(OpQueue.QueueType, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Owner''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''LEFT OUTER JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Owner''), ''OpQueue'', ''QueueId'', ''OpQueueMetric'', ''QueueId'', ''JOIN'', ''COALESCE(OpQueue.Owner, ''''null'''')'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), \ (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Version''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''LEFT OUTER JOIN'', null)';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisRowSQL(AnalysisRowSQLId, AnalysisRowId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisRowId FROM OpAnalysisRow JOIN OpAnalysisObject ON OpAnalysisRow.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisRow.Name = ''Version''), ''OpQueue'', ''QueueId'', ''OpQueueMetric'', ''QueueId'', ''JOIN'', ''COALESCE(OpQueue.QueueVersion, -1)'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''MAX_DISK_SPACE'', ''Max Disk Space'', ''bytes'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''MAX_FILES'', ''Max Files'', ''count'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''MAX_READ_COLLECTION_DELTA'', ''Max Read Collection Delta'', ''seconds'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''MAX_RECORDS'', ''Max Records'', ''count'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''MAX_RECORDS_SPACE'', ''Max Records Space'', ''percent'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregator(AnalysisAggregatorId, AnalysisObjectId, MetricName, Name, Units, AggregationType) VALUES(nextval(''hibernate_sequence''), \ (SELECT AnalysisObjectId FROM OpAnalysisObject WHERE Name = ''Queues''), ''WRITE_COLLECTION_DELTA'', ''Write Collection Delta'', ''seconds'', ''MAX'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisAggregator.Name = ''Max Disk Space''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''JOIN'', ''MAX(OpQueueMetricValue.Value)'', ''OpQueueMetric.MetricEnum'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisAggregator.Name = ''Max Files''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''JOIN'', ''MAX(OpQueueMetricValue.Value)'', ''OpQueueMetric.MetricEnum'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisAggregator.Name = ''Max Read Collection Delta''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''JOIN'', ''MAX(OpQueueMetricValue.Value)'', ''OpQueueMetric.MetricEnum'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisAggregator.Name = ''Max Records''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''JOIN'', ''MAX(OpQueueMetricValue.Value)'', ''OpQueueMetric.MetricEnum'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisAggregator.Name = ''Max Records Space''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''JOIN'', ''MAX(OpQueueMetricValue.Value)'', ''OpQueueMetric.MetricEnum'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'INSERT INTO OpAnalysisAggregatorSQL(AnalysisAggregatorSQLId, AnalysisAggregatorId, JoinTableName, JoinPKName, BaseTableName, BaseFKName, JoinType, AggregatorSQL, SelectSQL) VALUES (nextval(''hibernate_sequence''), (SELECT AnalysisAggregatorId FROM OpAnalysisAggregator JOIN OpAnalysisObject ON OpAnalysisAggregator.AnalysisObjectId = OpAnalysisObject.AnalysisObjectId WHERE OpAnalysisObject.Name = ''Queues'' AND OpAnalysisAggregator.Name = ''Write Collection Delta''), ''OpQueueMetric'', ''QueueMetricId'', ''OpQueueMetricValue'', ''QueueMetricId'', ''JOIN'', ''MAX(OpQueueMetricValue.Value)'', ''OpQueueMetric.MetricEnum'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Admins'', ''admins'', ''Y'', ''N'', ''Admins'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Account Admins'', ''account admins'', ''Y'', ''N'', ''Account Administration'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Environment Admins'', ''environment admins'', ''Y'', ''N'', ''Environment Configuration Administration'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Jobs Monitors (DEFAULT)'', ''jobs monitors (default)'', ''Y'', ''N'', ''Jobs Monitors (DEFAULT)'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Jobs Operators (DEFAULT)'', ''jobs operators (default)'', ''Y'', ''N'', ''Jobs Operators (DEFAULT)'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Jobs Schedulers (DEFAULT)'', ''jobs schedulers (default)'', ''Y'', ''N'', ''Jobs Schedulers (DEFAULT)'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Jobs Approvers (DEFAULT)'', ''jobs approvers (default)'', ''Y'', ''N'', ''Jobs Approvers (DEFAULT)'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Jobs System Admins (DEFAULT)'', ''jobs system admins (default)'', ''Y'', ''N'', ''Jobs System Admins (DEFAULT)'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Host Monitors'', ''host monitors'', ''Y'', ''N'', ''Host Monitors'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Host Admins'', ''host admins'', ''Y'', ''N'', ''Host Admins'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Product Monitors'', ''product monitors'', ''Y'', ''N'', ''Product Monitors'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Product Operators'', ''product operators'', ''Y'', ''N'', ''Product Operators'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin, DisplayName) values (nextval(''hibernate_sequence''), ''GROUP'', ''Product Admins'', ''product admins'', ''Y'', ''N'', ''Product Admins'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_ADMIN'' from OpPrincipal P where P.Name = ''Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_ACCOUNT_ADMIN'' from OpPrincipal P where P.Name = ''Account Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_ENV_ADMIN'' from OpPrincipal P where P.Name = ''Environment Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_HOST_MONITOR'' from OpPrincipal P where P.Name = ''Host Monitors''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_COMPUTER_KEY_ADMIN'' from OpPrincipal P where P.Name = ''Host Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n \ execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_HOST_ADMIN'' from OpPrincipal P where P.Name = ''Host Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_PRODUCT_MONITOR'' from OpPrincipal P where P.Name = ''Product Monitors''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_PRODUCT_OPERATOR'' from OpPrincipal P where P.Name = ''Product Operators''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_USER_KEY_ADMIN'' from OpPrincipal P where P.Name = ''Product Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_PRODUCT_ADMIN'' from OpPrincipal P where P.Name = ''Product Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n default_system integer;\nbegin\n select SystemId into default_system from OpSystem where name = 'DEFAULT';\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum, SystemId) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_OPERATOR'', ' || default_system || ' from OpPrincipal P where P.Name = ''Jobs Operators (DEFAULT)''';\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum, SystemId) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_MONITOR'', ' || default_system || ' from OpPrincipal P where P.Name = ''Jobs Monitors (DEFAULT)''';\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum, SystemId) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_DATA_VIEWER'', ' || default_system || ' from OpPrincipal P where P.Name = ''Jobs Monitors (DEFAULT)''';\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum, SystemId) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_SCHEDULER'', ' || default_system || ' from OpPrincipal P where P.Name = ''Jobs Schedulers (DEFAULT)''';\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum, SystemId) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_DATA_EDITOR'', ' || default_system || ' from OpPrincipal P where P.Name = ''Jobs Schedulers (DEFAULT)''';\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum, SystemId) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_APPROVER'', ' || default_system || ' from OpPrincipal P where P.Name = ''Jobs Approvers (DEFAULT)''';\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum, SystemId) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_SYSTEM_ADMIN'', ' || default_system || ' from OpPrincipal P where P.Name = ''Jobs System Admins (DEFAULT)''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''ocagent'', ''ocagent'', ''Y'', ''Y'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''admin'', ''admin'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''accountAdmin'', ''accountadmin'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''envAdmin'', ''envadmin'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''monitor'', ''monitor'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''operator'', ''operator'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''scheduler'', ''scheduler'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''approver'', ''approver'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''sysAdmin'', ''sysadmin'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''hostMonitor'', ''hostmonitor'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''hostAdmin'', ''hostadmin'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''productMonitor'', ''productmonitor'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''productOperator'', ''productoperator'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''productAdmin'', ''productadmin'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrincipal (PrincipalId, PrincipalDiscriminator, Name, LCName, IsEnabled, IsBuiltin) values (nextval(''hibernate_sequence''), ''USER'', ''analyst'', ''analyst'', ''N'', ''N'')';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_OCAGENT'' from OpPrincipal P where P.Name = ''ocagent''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpPrivilege (PrivilegeId, PrincipalId, RoleEnum) select nextval(''hibernate_sequence''), P.PrincipalId, ''ROLE_OP_ANALYST'' from OpPrincipal P where P.Name = ''analyst''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''admin'' and P.Name = ''Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''accountAdmin'' and P.Name = ''Account Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''envAdmin'' and P.Name = ''Environment Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''monitor'' and P.Name = ''Jobs Monitors (DEFAULT)''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''operator'' and P.Name = ''Jobs Operators (DEFAULT)''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''scheduler'' and P.Name = ''Jobs Schedulers (DEFAULT)''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''approver'' and P.Name = ''Jobs Approvers (DEFAULT)''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''sysAdmin'' and P.Name = ''Jobs System Admins (DEFAULT)''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''hostMonitor'' and P.Name = ''Host Monitors''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''hostAdmin'' and P.Name = ''Host Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''productMonitor'' and P.Name = ''Product Monitors''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''productOperator'' and P.Name = ''Product Operators''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpGroupXref (ChildPrincipalId, ParentGroupId) select C.PrincipalId, P.PrincipalId from OpPrincipal C, OpPrincipal P where C.Name = ''productAdmin'' and P.Name = ''Product Admins''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendar (CalendarId, SystemId, Name) select nextval(''hibernate_sequence''), \ SystemId, ''Everyday Calendar'' from OpSystem where Name = ''DEFAULT''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendar (CalendarId, SystemId, Name) select nextval(''hibernate_sequence''), \ SystemId, ''Weekdays Calendar'' from OpSystem where Name = ''DEFAULT''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendar (CalendarId, SystemId, Name) select nextval(''hibernate_sequence''), \ SystemId, ''Workdays Calendar'' from OpSystem where Name = ''DEFAULT''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'', 2023 from OpCalendar where Name = ''Everyday Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001'', 2023 from OpCalendar where Name = ''Weekdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''001111001111100111110011111001111100111110011111000111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110001111001111100111110011111001111100101110011111001111100111110011111001111100111110011111001111100011110011111001111100111110011111001111100111110011111001111100111110011111001110000111110011111001111100111110001111000'', 2023 from OpCalendar where Name = ''Workdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'', 2024 from OpCalendar where Name = ''Everyday Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011'', 2024 from OpCalendar where Name = ''Weekdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''011110011111001111100111110011111001111100111110001111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100011110011111001111100111110011111001110100111110011111001111100111110011111001111100111110011111000111100111110011111001111100111110011111001111100111110011111001111100111110011111001110000111110011111001111100110110011'', 2024 from OpCalendar where Name = ''Workdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'', 2025 from OpCalendar where Name = ''Everyday Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111'', 2025 from OpCalendar where Name = ''Weekdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''011001111100111110011111001111100111110011111000111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110001111001111100111110011111001111100111100011111001111100111110011111001111100111110011111001111100011110011111001111100111110011111001111100111110011111001111100111110011111001111100111000011111001111100111110011101001110'', 2025 from OpCalendar where Name = ''Workdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'', 2026 from OpCalendar where Name = ''Everyday Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111'', 2026 from OpCalendar where Name = ''Weekdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''010011111001111100111110011111001111100111110001111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100011110011111001111100111110011111001111000111110011111001111100111110011111001111100111110011111001111100011110011111001111100111110011111001111100111110011111001111100111110011111001110000111110011111001111100111100011110'', 2026 from OpCalendar where Name = ''Workdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'', 2027 from OpCalendar where Name = ''Everyday Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110'', 2027 from OpCalendar where Name = ''Weekdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''000111110011111001111100111110011111001111100011110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100011110011111001111100111110011111000111100111110011111001111100111110011111001111100111110011111000111100111110011111001111100111110011111001111100111110011111001111100111110011100001111100111110011111001111000111100'', 2027 from OpCalendar where Name = ''Workdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'', 2028 from OpCalendar where Name = ''Everyday Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100'', 2028 from OpCalendar where Name = ''Weekdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\nbegin\n execute E'insert into OpCalendarYear (CalendarId, Days, Year) select CalendarId, ''001111100111110011111001111100111110011111001111100011110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111000111100111110011111001111100111110010111001111100111110011111001111100111110011111001111100111110001111001111100111110011111001111100111110011111001111100111110011111001111100111000011111001111100111110011111000111100'', 2028 from OpCalendar where Name = ''Workdays Calendar''';\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\n-- ---------------------------------------------------\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from OpConfigValue where Name = 'client.analysisArea.maxDays';\n \ if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''The maximum number of days over which the Control>Center can perform an analysis. Default: 31'' WHERE Name = ''client.analysisArea.maxDays''';\n \ else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.analysisArea.maxDays'', ''The maximum number of days over which the Control>Center can perform an analysis. Default: 31'', ''INTEGER'', ''31'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.analysisArea.chart.maxColumns';\n if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''The maximum number of columns that the Control>Center can display in the Analysis area Timeline chart. Default: 48'' WHERE Name = ''client.analysisArea.chart.maxColumns''';\n \ else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.analysisArea.chart.maxColumns'', ''The maximum number of columns that the Control>Center can display in the Analysis area Timeline chart. Default: 48'', ''INTEGER'', ''48'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from OpConfigValue where Name = 'client.analysisArea.chart.minColumnWidthSecs';\n \ if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''The minimum width in seconds of a column in the Analysis area Timeline chart. Default: 86400 (1 day)'' WHERE Name = ''client.analysisArea.chart.minColumnWidthSecs''';\n \ else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.analysisArea.chart.minColumnWidthSecs'', ''The minimum width in seconds of a column in the Analysis area Timeline chart. \ Default: 86400 (1 day)'', ''INTEGER'', ''86400'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from OpConfigValue where Name = 'client.analysisArea.chart.displayGapMinutes';\n \ if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''The maximum number of minutes between metric line graph data points that should be regarded as continuous. Larger intervals result in the display of gaps. Default: 10'' WHERE Name = ''client.analysisArea.chart.displayGapMinutes''';\n \ else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.analysisArea.chart.displayGapMinutes'', ''The maximum number of minutes between metric line graph data points that should be regarded as continuous. Larger intervals result in the display of gaps. Default: 10'', ''INTEGER'', ''10'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.apiDoc.enabled';\n if (cnt > 0) then\n \ execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''Enables API documentation page. Default: 1'' WHERE Name = ''client.apiDoc.enabled''';\n else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), \ ''client.apiDoc.enabled'', ''Enables API documentation page. Default: 1'', ''INTEGER'', ''1'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.products.visible';\n if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''When 0, this hides the products page button from the navigation bar and excludes some products from appearing on the home area. Default: 0'' WHERE Name = ''client.products.visible''';\n \ else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.products.visible'', ''When 0, this hides the products page button from the navigation bar and excludes some products from appearing on the home area. Default: 0'', ''INTEGER'', ''0'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.analysis.visible';\n if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''When 0, this hides the analysis page button from the navigation bar. Default: 0'' WHERE Name = ''client.analysis.visible''';\n else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), \ ''client.analysis.visible'', ''When 0, this hides the analysis page button from the navigation bar. Default: 0'', ''INTEGER'', ''0'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from OpConfigValue where Name = 'client.automatedJobGeneration.allowPerApplication';\n \ if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''Allows you to disable automated job generation on a particular application in systems where automated job generation is enabled. Default: 0'' WHERE Name = ''client.automatedJobGeneration.allowPerApplication''';\n \ else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.automatedJobGeneration.allowPerApplication'', ''Allows you to disable automated job generation on a particular application in systems where automated job generation is enabled. Default: 0'', ''INTEGER'', ''0'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.configParamUnlock';\n if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''Control to limit configuration parameter access: 0 - no access, 1 - edit values, 2 - full control, including creating and deleting parameters. Default: 1'' WHERE Name = ''client.configParamUnlock''';\n else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), \ ''client.configParamUnlock'', ''Control to limit configuration parameter access: 0 - no access, 1 - edit values, 2 - full control, including creating and deleting parameters. Default: 1'', ''INTEGER'', ''1'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.dailyJobs.findJob.enabled';\n \ if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''Allows users to find a job across systems. Default 1'' WHERE Name = ''client.dailyJobs.findJob.enabled''';\n else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.dailyJobs.findJob.enabled'', ''Allows users to find a job across systems. Default 1'', ''INTEGER'', ''1'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.disableParameterEval';\n if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''INTEGER'', IsHidden = ''N'', Description = ''When set to 1, disables viewing of a graph or plan where viewing would cause a re-evaluation of the graph or plan''''s parameters. Default: 0'' WHERE Name = ''client.disableParameterEval''';\n \ else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.disableParameterEval'', ''When set to 1, disables viewing of a graph or plan where viewing would cause a re-evaluation of the graph or plan''''s parameters. Default: 0'', ''INTEGER'', ''0'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.excludeJobColumns';\n if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''STRING'', IsHidden = ''N'', Description = ''Comma-delimited list of columns to exclude from the Daily Jobs Area.'' WHERE Name = ''client.excludeJobColumns''';\n else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), \ ''client.excludeJobColumns'', ''Comma-delimited list of columns to exclude from the Daily Jobs Area.'', ''STRING'', ''End,Host Cluster,Job Definition,Job Definition Group,Job GUID'', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n select count(*) into cnt from OpConfigValue where Name = 'client.excludeJobsWithIssuesListColumns';\n if (cnt > 0) then\n \ execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''STRING'', IsHidden = ''N'', Description = ''Comma-delimited list of columns to exclude from the Jobs list in the Jobs Overview for All Systems sub-area. Default: '' WHERE Name = ''client.excludeJobsWithIssuesListColumns''';\n else\n execute E'INSERT INTO OpConfigValue (ConfigValueId, Name, Description, ValueTypeEnum, Value, IsHidden) VALUES (nextval(''hibernate_sequence''), ''client.excludeJobsWithIssuesListColumns'', ''Comma-delimited list of columns to exclude from the Jobs list in the Jobs Overview for All Systems sub-area. Default: '', ''STRING'', '''', ''N'')';\n end if;\nend;\n$$ LANGUAGE plpgsql;\nselect anonymous();\ndrop function anonymous();\n\n\ncreate or replace function anonymous() returns void as $$\ndeclare \n cnt integer;\nbegin\n \ select count(*) into cnt from OpConfigValue where Name = 'client.groupByAlso.job';\n \ if (cnt > 0) then\n execute E'UPDATE OpConfigValue SET ValueTypeEnum = ''STRING'', IsHidden = ''Y'', Description = ''FOR INTERNAL USE ONLY. Choices for the Daily Jobs sub-areas Group by menus. Comma-delimited list of