home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-11-13 | 45.0 KB | 1,321 lines
/****************************************************************************/ /* intercpt.sql is a member of the Visual Intercept Schema. */ /* Copyright (c) 1996 Elsinore Technologies, Inc. All rights reserved. */ /* */ /* This software is protected by copyright law. Unauthorized reproduction */ /* or distribution of this program, or any portion of it, may result in */ /* severe civil or criminal penalties. If you have any questions about */ /* your redistribution rights, please contact Elsinore Technologies, Inc. */ /* */ /* Creator: Mark J. Uland (MJU) */ /* History: Created 09/17/95 */ /****************************************************************************/ /****************************************************************************/ /* Microsoft SQL Object Manager SQL Script Generator */ /* */ /* Note 1: IF YOU ARE GOING TO INSTALL THIS PRODUCT TO A DATABASE OTHER */ /* THAN INTERCEPT, YOU MUST EDIT THIS SCRIPT TO USE THE CORRECT */ /* DATABASE AND TO ADD THE CORRECT USER LOGINS. THE PLACES YOU */ /* NEED TO EDIT ARE MARKED WITH 'SEE NOTE 1'. */ /* Note 2: IF YOU ARE INSTALLING OVER ANOTHER INTERCEPT DATABASE, YOU */ /* MUST MANUALLY DROP THE DATABASE. */ /* Note 3: YOU MAY WANT TO CREATE A DATABASE THAT REFLECTS YOUR */ /* ORGINIZATIONAL AND HARDWARE REQUIREMENTS MORE CLOSELY THAN */ /* A SIMPLE 'CREATE DATABASE'. YOU CAN USE THE SQL ADMINISTRATOR */ /* APPLICATION TO DO SO AND JUST COMMENT OUT THE CREATE DATABASE */ /* LINE FROM THIS SCRIPT. */ /* */ /****************************************************************************/ USE master GO IF EXISTS (SELECT * FROM master.dbo.sysdatabases WHERE name='intercept') /* SEE NOTE 1 */ BEGIN RAISERROR 20010 "This database already exists. Use upgrade script"/* SEE NOTE 2 */ RETURN END GO PRINT 'Creating Visual Intercept database' CREATE DATABASE intercept /* SEE NOTE 1 *//* SEE NOTE 3 */ GO USE intercept /* SEE NOTE 1 */ GO /****************************************************************************/ /* */ /* Create stock Visual Intercept users with in SQL Server. */ /* */ /* Visual Intercept handles two kinds of logon security schemes. The first */ /* scheme uses a behind the scenes, universal database userID and password */ /* that is used to connect the Visual Intercept user to the actual DBMS. */ /* If this logon is successful, then the userID and password the user has */ /* entered in the Visual Intercept Security Dialog is validated against */ /* the Users table. The second scheme is a pass-through scheme that takes */ /* the userID and password entered in the Visual Intercept Security Dialog */ /* and attempts to connect to the actual DBMS with them. If this is */ /* successful, then only the userID is then validated against the Users */ /* table. The first scheme is easier to administrate but all users look */ /* like a single user to the database administrator. The second is more */ /* secure and easier to monitor, but potentially harder to administrate. */ /* See the manual for details. */ /* */ /****************************************************************************/ IF NOT EXISTS (SELECT * FROM sysusers WHERE name = 'guest') BEGIN PRINT 'Adding guest login' EXEC sp_addlogin guest, 'guest', intercept, NULL /* SEE NOTE 1 */ EXEC sp_adduser 'guest','guest' END GO IF NOT EXISTS (SELECT * FROM sysusers WHERE name = 'isadmin') BEGIN PRINT 'Adding isadmin login' EXEC sp_addlogin isadmin, 'isadmin', intercept, NULL /* SEE NOTE 1 */ EXEC sp_adduser 'isadmin','isadmin' END GO IF NOT EXISTS (SELECT * FROM sysusers WHERE name = 'isnotify') BEGIN PRINT 'Adding isnotify login' EXEC sp_addlogin isnotify, 'isnotify', intercept, NULL /* SEE NOTE 1 */ EXEC sp_adduser 'isnotify','isnotify' END GO IF NOT EXISTS (SELECT * FROM sysusers WHERE name = 'isuser') BEGIN PRINT 'Adding isuser login' EXEC sp_addlogin isuser, 'isuser', intercept, NULL /* SEE NOTE 1 */ EXEC sp_adduser 'isuser','isuser' END GO /****************************************************************************/ /* */ /* Drop existing Visual Intercept tables if they already exist */ /* */ /****************************************************************************/ IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Account')) BEGIN PRINT 'Dropping old version of dbo.Account' DROP table dbo.Account END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Account_Contacts')) BEGIN PRINT 'Dropping old version of dbo.Account_Contacts' DROP table dbo.Account_Contacts END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Contact')) BEGIN PRINT 'Dropping old version of dbo.Contact' DROP table dbo.Contact END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Contact_Type')) BEGIN PRINT 'Dropping old version of dbo.Contact_Type' DROP table dbo.Contact_Type END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Defaults')) BEGIN PRINT 'Dropping old version of dbo.Defaults' DROP table dbo.Defaults END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Group_Security')) BEGIN PRINT 'Dropping old version of dbo.Group_Security' DROP table dbo.Group_Security END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Incident')) BEGIN PRINT 'Dropping old version of dbo.Incident' DROP table dbo.Incident END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Incident_Contacts')) BEGIN PRINT 'Dropping old version of dbo.Incident_Contacts' DROP table dbo.Incident_Contacts END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Incident_Documents')) BEGIN PRINT 'Dropping old version of dbo.Incident_Documents' DROP table dbo.Incident_Documents END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Incident_History')) BEGIN PRINT 'Dropping old version of dbo.Incident_History' DROP table dbo.Incident_History END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Incident_Incidents')) BEGIN PRINT 'Dropping old version of dbo.Incident_Incidents' DROP table dbo.Incident_Incidents END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Incident_Sources')) BEGIN PRINT 'Dropping old version of dbo.Incident_Sources' DROP table dbo.Incident_Sources END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Category_Type')) BEGIN PRINT 'Dropping old version of dbo.Category_Type' DROP table dbo.Category_Type END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Notify')) BEGIN PRINT 'Dropping old version of dbo.Notify' DROP table dbo.Notify END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Notify_Trigger')) BEGIN PRINT 'Dropping old version of dbo.Notify_Trigger' DROP table dbo.Notify_Trigger END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Priority_Type')) BEGIN PRINT 'Dropping old version of dbo.Priority_Type' DROP table dbo.Priority_Type END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Project')) BEGIN PRINT 'Dropping old version of dbo.Project' DROP table dbo.Project END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Project_Projects')) BEGIN PRINT 'Dropping old version of dbo.Project_Projects' DROP table dbo.Project_Projects END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Project_Security')) BEGIN PRINT 'Dropping old version of dbo.Project_Security' DROP table dbo.Project_Security END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Project_Versions')) BEGIN PRINT 'Dropping old version of dbo.Project_Versions' DROP table dbo.Project_Versions END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Related_Type')) BEGIN PRINT 'Dropping old version of dbo.Related_Type' DROP table dbo.Related_Type END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Report')) BEGIN PRINT 'Dropping old version of dbo.Report' DROP table dbo.Report END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Severity_Type')) BEGIN PRINT 'Dropping old version of dbo.Severity_Type' DROP table dbo.Severity_Type END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Status_Type')) BEGIN PRINT 'Dropping old version of dbo.Status_Type' DROP table dbo.Status_Type END GO IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id('dbo.Users')) BEGIN PRINT 'Dropping old version of dbo.Users' DROP table dbo.Users END GO /****************************************************************************/ /* */ /* Create Visual Intercept tables */ /* */ /****************************************************************************/ /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Account' PRINT '' /****************************************************************************/ GO CREATE TABLE Account ( Code varchar ( 32 ) NOT NULL, Name varchar ( 64 ) NOT NULL, UserID varchar ( 128 ) NULL, Description text NULL, Rate money NULL, ts char ( 16) NULL ) GO /* */ PRINT '' PRINT 'Creating Index: AccountUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX AccountUCPK ON Account ( Code ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Account_Contacts' PRINT '' /****************************************************************************/ GO CREATE TABLE Account_Contacts ( AccountCode varchar ( 32 ) NOT NULL, ContactID int NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Account_ContactsUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Account_ContactsUCPK ON Account_Contacts ( AccountCode, ContactID ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Contact' PRINT '' /****************************************************************************/ GO CREATE TABLE Contact ( ContactID int NOT NULL, FirstName varchar ( 32 ) NOT NULL, LastName varchar ( 32 ) NOT NULL, Title varchar ( 32 ) NULL, Company varchar ( 32 ) NULL, Department varchar ( 32 ) NULL, Address varchar ( 64 ) NULL, City varchar ( 32 ) NULL, State varchar ( 5 ) NULL, Zip varchar ( 20 ) NULL, Region varchar ( 10 ) NULL, Country varchar ( 32 ) NULL, PrimaryPhone varchar ( 20 ) NULL, SecondaryPhone varchar ( 20 ) NULL, Pager varchar ( 20 ) NULL, FaxNumber varchar ( 20 ) NULL, Email varchar ( 128 ) NULL, Description text NULL, ContactType varchar ( 32 ) NOT NULL, ts char ( 16) NULL ) GO /* */ PRINT '' PRINT 'Creating Index: ContactUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX ContactUCPK ON Contact ( ContactID ) GO /* */ PRINT '' PRINT 'Creating Index: ContactFNSK' PRINT '' /* */ GO CREATE INDEX ContactFNSK ON Contact ( FirstName ) GO /* */ PRINT '' PRINT 'Creating Index: ContactLNSK' PRINT '' /* */ GO CREATE INDEX ContactLNSK ON Contact ( LastName ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Contact_Type' PRINT '' /****************************************************************************/ GO CREATE TABLE Contact_Type ( Name varchar ( 32 ) NOT NULL, Description text NULL, Weight float NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Contact_TypeUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Contact_TypeUCPK ON Contact_Type ( Name ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Defaults' PRINT '' /****************************************************************************/ GO CREATE TABLE Defaults ( ConfigurationID int NOT NULL, ArchivePeriod datetime NOT NULL, NextIncidentID int NOT NULL, NextContactID int NOT NULL, NextStamp char ( 16 ) NOT NULL, AdministratorID varchar( 128 ) NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: DefaultsUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX DefaultsUCPK ON Defaults ( ConfigurationID ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Group_Security' PRINT '' /****************************************************************************/ GO CREATE TABLE Group_Security ( GroupID varchar(32) NOT NULL, AccountInsert smallint NOT NULL, AccountDelete smallint NOT NULL, AccountModify smallint NOT NULL, AccountFetch smallint NOT NULL, ContactInsert smallint NOT NULL, ContactDelete smallint NOT NULL, ContactModify smallint NOT NULL, ContactFetch smallint NOT NULL, IncidentInsert smallint NOT NULL, IncidentDelete smallint NOT NULL, IncidentModify smallint NOT NULL, IncidentFetch smallint NOT NULL, ProjectInsert smallint NOT NULL, ProjectDelete smallint NOT NULL, ProjectModify smallint NOT NULL, ProjectFetch smallint NOT NULL, ts char(16) NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Group_SecurityUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Group_SecurityUCPK ON Group_Security ( GroupID ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Incident' PRINT '' /****************************************************************************/ GO CREATE TABLE Incident ( IncidentID int NOT NULL, ProjectName varchar ( 255 ) NOT NULL, VersionName varchar ( 32 ) NOT NULL, Subject varchar ( 128 ) NOT NULL, Description text NULL, Resolution text NULL, WorkAround text NULL, Status varchar ( 32 ) NULL, Priority varchar ( 32 ) NULL, Category varchar ( 32 ) NULL, Severity varchar ( 32 ) NULL, IncidentName varchar ( 32 ) NULL, ProjectedTime int NULL, ActualTime int NULL, RequestID varchar ( 128 ) NOT NULL, AssignID varchar ( 128 ) NULL, ChangeID varchar ( 128 ) NOT NULL, StartDate datetime NOT NULL, AssignDate datetime NULL, ChangeDate datetime NOT NULL, ts char ( 16) NULL ) GO /* */ PRINT '' PRINT 'Creating Index: IncidentUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX IncidentUCPK ON Incident ( IncidentID ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Incident_Contacts' PRINT '' /****************************************************************************/ GO CREATE TABLE Incident_Contacts ( IncidentID int NOT NULL, ContactID int NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Incident_ContactsUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Incident_ContactsUCPK ON Incident_Contacts ( IncidentID, ContactID ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Incident_Documents' PRINT '' /****************************************************************************/ GO CREATE TABLE Incident_Documents ( IncidentID int NOT NULL, Name varchar ( 248 ) NOT NULL, DocumentID varchar ( 248 ) NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Incident_DocumentsUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Incident_DocumentsUCPK ON Incident_Documents ( IncidentID, DocumentID ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Incident_History' PRINT '' /****************************************************************************/ GO CREATE TABLE Incident_History ( IncidentID int NOT NULL, ProjectName varchar ( 255 ) NOT NULL, VersionName varchar ( 32 ) NOT NULL, Status varchar ( 32 ) NULL, Priority varchar ( 32 ) NULL, Severity varchar ( 32 ) NULL, ProjectedTime int NULL, ActualTime int NULL, RequestID varchar ( 128 ) NOT NULL, AssignID varchar ( 128 ) NULL, ChangeID varchar ( 128 ) NOT NULL, ChangeDate datetime NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Incident_HistoryUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Incident_HistoryUCPK ON Incident_History ( IncidentID, ChangeDate ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Incident_Incidents' PRINT '' /****************************************************************************/ GO CREATE TABLE Incident_Incidents ( IncidentID int NOT NULL, RelatedIncidentID int NOT NULL, RelatedType varchar ( 32 ) NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Incident_IncidentsUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Incident_IncidentsUCPK ON Incident_Incidents ( IncidentID, RelatedIncidentID, RelatedType ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Incident_Sources' PRINT '' /****************************************************************************/ GO CREATE TABLE Incident_Sources ( IncidentID int NOT NULL, Name varchar ( 128 ) NOT NULL, Version varchar ( 32 ) NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Incident_SourcesUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Incident_SourcesUCPK ON Incident_Sources ( IncidentID, Name, Version ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Category_Type' PRINT '' /****************************************************************************/ GO CREATE TABLE Category_Type ( Name varchar ( 32 ) NOT NULL, Description text NULL, Weight float NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Category_TypeUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Category_TypeUCPK ON Category_Type ( Name ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Notify' PRINT '' /****************************************************************************/ GO CREATE TABLE Notify ( SourceID varchar (128 ) NOT NULL, DestinationID varchar (128 ) NOT NULL, KeyValue varchar (255 ) NOT NULL, Description varchar (255 ) NOT NULL, Type smallint NOT NULL, Action smallint NOT NULL, Options int NOT NULL, NotifyDate datetime NOT NULL, ts char ( 16 ) NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: NotifyUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX NotifyUCPK ON Notify ( NotifyDate, DestinationID, SourceID ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Notify_Trigger' PRINT '' /****************************************************************************/ GO CREATE TABLE Notify_Trigger ( SourceID varchar (128 ) NOT NULL, KeyValue varchar (255 ) NOT NULL, Description varchar (255 ) NOT NULL, Type smallint NOT NULL, Action smallint NOT NULL, Options int NOT NULL, NotifyDate datetime NOT NULL, ts char ( 16 ) NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Notify_TriggerUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Notify_TriggerUCPK ON Notify_Trigger ( ts ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Priority_Type' PRINT '' /****************************************************************************/ GO CREATE TABLE Priority_Type ( Name varchar ( 32 ) NOT NULL, Description text NULL, Weight float NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Priority_TypeUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Priority_TypeUCPK ON Priority_Type ( Name ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Project' PRINT '' /****************************************************************************/ GO CREATE TABLE Project ( Name varchar ( 255 ) NOT NULL, Description text NULL, Lead varchar ( 128 ) NULL, AccountCode varchar ( 32 ) NULL, ts char ( 16) NULL ) GO /* */ PRINT '' PRINT 'Creating Index: ProjectUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX ProjectUCPK ON Project ( Name ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Project_Projects' PRINT '' /****************************************************************************/ GO CREATE TABLE Project_Projects ( ProjectName varchar ( 255 ) NOT NULL, RelatedProjectName varchar ( 255 ) NOT NULL, RelatedType varchar ( 32 ) NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Project_ProjectsPSK' PRINT '' /* */ GO CREATE INDEX Project_ProjectsPSK ON Project_Projects ( ProjectName ) GO /* */ PRINT '' PRINT 'Creating Index: Project_ProjectsRPSK' PRINT '' /* */ GO CREATE INDEX Project_ProjectsRPSK ON Project_Projects ( RelatedProjectName ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Project_Security' PRINT '' /****************************************************************************/ GO CREATE TABLE Project_Security ( UserID varchar ( 128 ) NOT NULL, GroupID varchar ( 32 ) NOT NULL, ProjectName varchar ( 255 ) NOT NULL ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Project_Versions' PRINT '' /****************************************************************************/ GO CREATE TABLE Project_Versions ( ProjectName varchar ( 255 ) NOT NULL, VersionName varchar ( 32 ) NOT NULL, Description text NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Project_VersionsPSK' PRINT '' /* */ GO CREATE INDEX Project_VersionsPSK ON Project_Versions ( ProjectName ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Related_Type' PRINT '' /****************************************************************************/ GO CREATE TABLE Related_Type ( Name varchar ( 32 ) NOT NULL, Description text NULL, Weight float NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Related_TypeUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Related_TypeUCPK ON Related_Type ( Name ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Report' PRINT '' /****************************************************************************/ GO CREATE TABLE Report ( Name varchar ( 32 ) NOT NULL, Description varchar ( 128 ) NULL, Type int NOT NULL, FileName varchar ( 255 ) NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: ReportUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX ReportUCPK ON Report ( Name, Type ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Severity_Type' PRINT '' /****************************************************************************/ GO CREATE TABLE Severity_Type ( Name varchar ( 32 ) NOT NULL, Description text NULL, Weight float NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Severity_TypeUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Severity_TypeUCPK ON Severity_Type ( Name ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Status_Type' PRINT '' /****************************************************************************/ GO CREATE TABLE Status_Type ( Name varchar ( 32 ) NOT NULL, Description text NULL, Weight float NOT NULL ) GO /* */ PRINT '' PRINT 'Creating Index: Status_TypeUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX Status_TypeUCPK ON Status_Type ( Name ) GO /****************************************************************************/ PRINT '' PRINT 'Creating Table: dbo.Users' PRINT '' /****************************************************************************/ GO CREATE TABLE Users ( UserID varchar (128 ) NOT NULL, Password varchar ( 12 ) NULL, ts char ( 16) NULL ) GO /* */ PRINT '' PRINT 'Creating Index: UsersUCPK' PRINT '' /* */ GO CREATE UNIQUE CLUSTERED INDEX UsersUCPK ON Users ( UserID ) GO /****************************************************************************/ PRINT '' PRINT 'Granting Access' PRINT '' /****************************************************************************/ GRANT SELECT, UPDATE, INSERT, DELETE ON Account TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Account_Contacts TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Contact TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Contact_Type TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Defaults TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Group_Security TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Incident TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Incident_Contacts TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Incident_Documents TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Incident_History TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Incident_Incidents TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Incident_Sources TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Category_Type TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Notify TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Notify_Trigger TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Priority_Type TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Project TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Project_Projects TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Project_Security TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Project_Versions TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Related_Type TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Report TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Severity_Type TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Status_Type TO PUBLIC GO GRANT SELECT, UPDATE, INSERT, DELETE ON Users TO PUBLIC GO /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept default data' PRINT '' /***************************************************************************/ /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept Users' PRINT '' /***************************************************************************/ INSERT INTO Users (UserID,Password,ts) VALUES ("guest",NULL,"0000000000000001") GO INSERT INTO Users (UserID,Password,ts) VALUES ("isadmin",NULL,"0000000000000001") GO INSERT INTO Users (UserID,Password,ts) VALUES ("isnotify",NULL,"0000000000000001") GO INSERT INTO Users (UserID,Password,ts) VALUES ("isuser",NULL,"0000000000000001") GO /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept Contact Types' PRINT '' /***************************************************************************/ INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Alpha Tester","Alpha Tester Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Beta Tester","Beta Tester Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Customer","Customer Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Press","Press Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Industry","Industry Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Evaluation","Evaluation Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Lead","Lead Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Employee","Employee Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Resource","Resource Description") GO INSERT INTO Contact_Type (Weight,Name,Description) VALUES (1.0,"Account Manager","Account Manager") GO /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept Category Types' PRINT '' /***************************************************************************/ INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.00,"Automated Test","Incident was registered through an automated testing tool.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.75,"Code Error","Incident is a result of incorrect code implementation.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.05,"Cosmetic","Incident is regarding a feature that works as intended, but could look better.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.50,"Change Request","Incident is a request to change application functionality.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.50,"Configuration","Incident is a result of configuration issues.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (1.00,"Design Flaw","Incident is a result of a application design flaw.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.75,"Documentation","Incident is a result of incorrect documentation for an application feature.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.50,"Education","Incident requires educating users on feature functionality and usage.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.50,"Integration","Incident is a result of integration issues.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.50,"Internal","Incident is a result of internal discussion, outside the usual development process.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.50,"New Feature","Incident is a request for a totally new feature to extend application functionality.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (1.00,"Requirement","Incident is a required feature that has not been implemented according to specifications.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.50,"Source Inspection","Incident is a result of a code review.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (0.75,"Third Party","Incident is a result of a 3rd party product.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (1.00,"Unknown","Incident is of unknown type.") GO INSERT INTO Category_Type (Weight,Name,Description) VALUES (1.00,"N/A","Category is not applicable.") GO /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept Priority Types' PRINT '' /***************************************************************************/ INSERT INTO Priority_Type (Weight,Name,Description) VALUES (1.00,"Urgent","Incident is extremely urgent and requires immediate attention.") GO INSERT INTO Priority_Type (Weight,Name,Description) VALUES (0.75,"High","Incident is important and should be resolved as soon as possible.") GO INSERT INTO Priority_Type (Weight,Name,Description) VALUES (0.50,"Medium","Incident is important but can be resolved in a reasonable time frame.") GO INSERT INTO Priority_Type (Weight,Name,Description) VALUES (0.25,"Low","Incident is not critical and can be resolved as time and resources allow.") GO INSERT INTO Priority_Type (Weight,Name,Description) VALUES (1.00,"N/A","Priority is not applicable.") GO /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept Related Types' PRINT '' /***************************************************************************/ INSERT INTO Related_Type (Weight,Name,Description) VALUES (1.0,"Affected","Affected by current document") GO INSERT INTO Related_Type (Weight,Name,Description) VALUES (1.0,"Cause","Cause of current document") GO INSERT INTO Related_Type (Weight,Name,Description) VALUES (1.0,"Same","Same as current document") GO INSERT INTO Related_Type (Weight,Name,Description) VALUES (1.0,"Example","Example of current document") GO INSERT INTO Related_Type (Weight,Name,Description) VALUES (1.0,"Information","Extra information of current document") GO /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept Severity Types' PRINT '' /***************************************************************************/ INSERT INTO Severity_Type (Weight,Name,Description) VALUES (0.25,"Annoying","Incident produces annoying behaviour.") GO INSERT INTO Severity_Type (Weight,Name,Description) VALUES (0.50,"Confusion","Incident produces confusing behaviour.") GO INSERT INTO Severity_Type (Weight,Name,Description) VALUES (1.00,"Crash","Incident causes system crash.") GO INSERT INTO Severity_Type (Weight,Name,Description) VALUES (0.75,"Unexpected","Incident produces unexpected behaviour.") GO INSERT INTO Severity_Type (Weight,Name,Description) VALUES (1.00,"N/A","Severity is not applicable.") GO /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept Status Types' PRINT '' /***************************************************************************/ INSERT INTO Status_Type (Weight,Name,Description) VALUES (1.00,"New","Incident has entered the system, but no one has looked at it yet.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.70,"Open","The appropriate resource to handle the Incident is being determined.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.80,"ReOpen","The Incident has resurfaced after it was officially closed.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.5,"Investigation","The actual cause of the Incident is being determined.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.25,"Development","Incident fix is under development.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.0,"Suspended","Work on the Incident has been suspended until further notice.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.0,"Rejected","Incident has been rejected.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.0,"Duplicate","Incident is a duplicate of an already known Incident.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.0,"Not Reproducible","Incident is not reproducible.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.25,"Unit Test","The Incident fix is being tested by itself.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.20,"System Test","The Incident fix is being tested with the entire system.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.10,"Q/A","The Incident fix is being tested by Quality Assurance.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (0.00,"Closed","The Incident has been successfully dealt with and is now closed.") GO INSERT INTO Status_Type (Weight,Name,Description) VALUES (1.00,"N/A","Status is not applicable.") GO /***************************************************************************/ PRINT '' PRINT 'Creating Visual Intercept Group Security' PRINT '' /***************************************************************************/ INSERT INTO Group_Security (GroupID, AccountInsert,AccountDelete,AccountModify,AccountFetch, ContactInsert,ContactDelete,ContactModify,ContactFetch, IncidentInsert,IncidentDelete,IncidentModify,IncidentFetch, ProjectInsert,ProjectDelete,ProjectModify,ProjectFetch,ts) VALUES ("Administrator",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"0000000000000010") GO INSERT INTO Group_Security (GroupID, AccountInsert,AccountDelete,AccountModify,AccountFetch, ContactInsert,ContactDelete,ContactModify,ContactFetch, IncidentInsert,IncidentDelete,IncidentModify,IncidentFetch, ProjectInsert,ProjectDelete,ProjectModify,ProjectFetch,ts) VALUES ("Director",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"0000000000000011") GO INSERT INTO Group_Security (GroupID, AccountInsert,AccountDelete,AccountModify,AccountFetch, ContactInsert,ContactDelete,ContactModify,ContactFetch, IncidentInsert,IncidentDelete,IncidentModify,IncidentFetch, ProjectInsert,ProjectDelete,ProjectModify,ProjectFetch,ts) VALUES ("Project Lead",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"0000000000000012") GO INSERT INTO Group_Security (GroupID, AccountInsert,AccountDelete,AccountModify,AccountFetch, ContactInsert,ContactDelete,ContactModify,ContactFetch, IncidentInsert,IncidentDelete,IncidentModify,IncidentFetch, ProjectInsert,ProjectDelete,ProjectModify,ProjectFetch,ts) VALUES ("Developer",1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,1,"0000000000000013") GO INSERT INTO Group_Security (GroupID, AccountInsert,AccountDelete,AccountModify,AccountFetch, ContactInsert,ContactDelete,ContactModify,ContactFetch, IncidentInsert,IncidentDelete,IncidentModify,IncidentFetch, ProjectInsert,ProjectDelete,ProjectModify,ProjectFetch,ts) VALUES ("Support",1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,1,"0000000000000014") GO INSERT INTO Group_Security (GroupID, AccountInsert,AccountDelete,AccountModify,AccountFetch, ContactInsert,ContactDelete,ContactModify,ContactFetch, IncidentInsert,IncidentDelete,IncidentModify,IncidentFetch, ProjectInsert,ProjectDelete,ProjectModify,ProjectFetch,ts) VALUES ("Help Desk",1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,1,"0000000000000015") GO INSERT INTO Group_Security (GroupID, AccountInsert,AccountDelete,AccountModify,AccountFetch, ContactInsert,ContactDelete,ContactModify,ContactFetch, IncidentInsert,IncidentDelete,IncidentModify,IncidentFetch, ProjectInsert,ProjectDelete,ProjectModify,ProjectFetch,ts) VALUES ("Quality Assurance",1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,1,"0000000000000016") GO /***************************************************************************/ PRINT '' PRINT 'Inserting Visual Intercept Reports' PRINT '' /***************************************************************************/ INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Account bullet","Account bullet",258,"isacctbl.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Account verbose","Account verbose",1026,"ispracct.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Contact bullet","Contact bullet",259,"iscontbl.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Contact verbose","Contact verbose",1027,"isprcont.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incident bullet","Incident bullet",260,"isincdbl.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incident verbose","Incident verbose",1028,"isprincd.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Project bullet","Project bullet",261,"isprojbl.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Project verbose","Project verbose",1029,"isprproj.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Group bullet","Group bullet",262,"isgrupbl.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Group verbose","Group verbose",1030,"isprgrup.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("User bullet","User bullet",263,"isuserbl.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("User verbose","User verbose",1031,"ispruser.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incidents by Status","Incidents by Status",270532611,"grstat.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incidents by Priority","Incidents by Priority",270532611,"grprior.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incidents by Severity","Incidents by Severity",270532611,"grsever.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incidents by Project","Incidents by Project",270532611,"grproj.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incidents by AssignID","Incidents by AssignID",270532611,"grassign.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incidents by RequestID","Incidents by RequestID",270532611,"grreq.rpt") GO INSERT INTO Report (Name,Description,Type,FileName) VALUES ("Incidents Count","Incident Count",269488131,"grcount.rpt") GO /***************************************************************************/ PRINT '' PRINT 'Inserting Visual Intercept Defaults' PRINT '' /***************************************************************************/ INSERT INTO Defaults (ConfigurationID,ArchivePeriod,NextIncidentID,NextContactID,NextStamp,AdministratorID) VALUES (1,"12/31/95",0,0,"0000000000000001","isadmin") GO