forked from DNNCommunity/DNN.Links
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Uninstall.SqlDataProvider
53 lines (41 loc) · 2.86 KB
/
Uninstall.SqlDataProvider
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/************************************************************/
/***** Uninstall.SqlDataProvider *****/
/***** *****/
/***** *****/
/***** Note: To manually execute this script you must *****/
/***** perform a search and replace operation *****/
/***** for {databaseOwner} and {objectQualifier} *****/
/***** *****/
/************************************************************/
/** Drop Links Table **/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'FK_{objectQualifier}Links_{objectQualifier}Modules') AND OBJECTPROPERTY(id, N'IsConstraint') = 1)
ALTER TABLE {databaseOwner}[{objectQualifier}Links] DROP CONSTRAINT [FK_{objectQualifier}Links_{objectQualifier}Modules]
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'PK_{objectQualifier}{objectQualifier}Links') AND OBJECTPROPERTY(id, N'IsConstraint') = 1)
ALTER TABLE {databaseOwner}[{objectQualifier}Links] DROP CONSTRAINT [PK_{objectQualifier}Links]
GO
/*IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'IX_{objectQualifier}Links') AND OBJECTPROPERTY(id, N'IsIndex') = 1)
DROP INDEX {databaseOwner}[{objectQualifier}Links].[IX_{objectQualifier}Links]
GO*/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{objectQualifier}Links') AND OBJECTPROPERTY(id, N'IsTable') = 1)
DROP TABLE {databaseOwner}[{objectQualifier}Links]
GO
/** Drop Stored Procedures **/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}dnnLinks_GetLink]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE {databaseOwner}[{objectQualifier}dnnLinks_GetLink]
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}dnnLinks_GetLinks]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE {databaseOwner}[{objectQualifier}dnnLinks_GetLinks]
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}dnnLinks_UpdateLink]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE {databaseOwner}[{objectQualifier}dnnLinks_UpdateLink]
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}dnnLinks_DeleteLink]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE {databaseOwner}[{objectQualifier}dnnLinks_DeleteLink]
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}dnnLinks_AddLink]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE {databaseOwner}[{objectQualifier}dnnLinks_AddLink]
GO
/************************************************************/
/***** SqlDataProvider *****/
/************************************************************/