Hi All
The following files do not use the {objectQualifier} tag for constraint names. This means that the code fails when you try to install a second store to a database.
02.00.00.SqlDataProvider
02.00.03.SqlDataProvider
02.00.06.SqlDataProvider
A unified diff that fixes the problem is included below.
Thanks
Stuart
Index: 02.00.00.SqlDataProvider
===================================================================
--- 02.00.00.SqlDataProvider (revision 53)
+++ 02.00.00.SqlDataProvider (working copy)
@@ -5,7 +5,7 @@
ALTER TABLE {databaseOwner}{objectQualifier}Store_Administration
- ADD [ShowTax] [bit] NOT NULL CONSTRAINT [DF_Store_Administration_ShowTax] DEFAULT ((0))
+ ADD [ShowTax] [bit] NOT NULL CONSTRAINT [DF_{objectQualifier}Store_Administration_ShowTax] DEFAULT ((0))
GO
@@ -23,16 +23,16 @@
ALTER TABLE {databaseOwner}{objectQualifier}Store_Orders
- ADD [OrderIsPlaced] [bit] NOT NULL CONSTRAINT [DF_Store_Orders_OrderIsPlaced] DEFAULT ((0))
+ ADD [OrderIsPlaced] [bit] NOT NULL CONSTRAINT [DF_{objectQualifier}Store_Orders_OrderIsPlaced] DEFAULT ((0))
GO
ALTER TABLE {databaseOwner}{objectQualifier}Store_Orders
- ADD [OrderStatusID] [int] NOT NULL CONSTRAINT [DF_Store_Orders_OrderStatus] DEFAULT ((1))
+ ADD [OrderStatusID] [int] NOT NULL CONSTRAINT [DF_{objectQualifier}Store_Orders_OrderStatus] DEFAULT ((1))
GO
ALTER TABLE {databaseOwner}{objectQualifier}Store_Products
- ADD [ProductWeight] [decimal] (10, 2) NOT NULL CONSTRAINT [DF_Store_Products_ProductWeight] DEFAULT ((1))
+ ADD [ProductWeight] [decimal] (10, 2) NOT NULL CONSTRAINT [DF_{objectQualifier}Store_Products_ProductWeight] DEFAULT ((1))
GO
ALTER TABLE {databaseOwner}{objectQualifier}Store_Products
@@ -58,7 +58,7 @@
GO
ALTER TABLE {databaseOwner}{objectQualifier}Store_OrderStatus
- ADD CONSTRAINT [PK_Store_OrderStatus] PRIMARY KEY CLUSTERED ([OrderStatusID])
+ ADD CONSTRAINT [PK_{objectQualifier}Store_OrderStatus] PRIMARY KEY CLUSTERED ([OrderStatusID])
GO
CREATE TABLE {databaseOwner}{objectQualifier}Store_ShippingRates
@@ -71,9 +71,9 @@
[Cost] [money] NOT NULL
)
-ALTER TABLE {databaseOwner}{objectQualifier}Store_ShippingRates ADD CONSTRAINT [PK_Store_ShippingRates] PRIMARY KEY CLUSTERED ([ID])
+ALTER TABLE {databaseOwner}{objectQualifier}Store_ShippingRates ADD CONSTRAINT [PK_{objectQualifier}Store_ShippingRates] PRIMARY KEY CLUSTERED ([ID])
GO
-ALTER TABLE {databaseOwner}{objectQualifier}Store_Orders ADD CONSTRAINT [FK_Store_Orders_Store_Orders] FOREIGN KEY ([OrderID]) REFERENCES {databaseOwner}{objectQualifier}Store_Orders ([OrderID])
+ALTER TABLE {databaseOwner}{objectQualifier}Store_Orders ADD CONSTRAINT [FK_{objectQualifier}Store_Orders_{objectQualifier}Store_Orders] FOREIGN KEY ([OrderID]) REFERENCES {databaseOwner}{objectQualifier}Store_Orders ([OrderID])
GO
INSERT INTO {databaseOwner}{objectQualifier}Store_OrderStatus(OrderStatusText, ListOrder)
@@ -91,7 +91,7 @@
GO
-ALTER TABLE {databaseOwner}{objectQualifier}Store_Orders ADD CONSTRAINT [FK_Store_Orders_Store_OrderStatus] FOREIGN KEY ([OrderStatusID]) REFERENCES {databaseOwner}{objectQualifier}Store_OrderStatus ([OrderStatusID])
+ALTER TABLE {databaseOwner}{objectQualifier}Store_Orders ADD CONSTRAINT [FK_{objectQualifier}Store_Orders_{objectQualifier}Store_OrderStatus] FOREIGN KEY ([OrderStatusID]) REFERENCES {databaseOwner}{objectQualifier}Store_OrderStatus ([OrderStatusID])
GO
CREATE PROCEDURE {databaseOwner}{objectQualifier}Store_Orders_GetOrdersByStatusID
Index: 02.00.03.SqlDataProvider
===================================================================
--- 02.00.03.SqlDataProvider (revision 53)
+++ 02.00.03.SqlDataProvider (working copy)
@@ -1,6 +1,6 @@
if not exists (select * from dbo.sysobjects where name = 'DF_Store_Products_IsDeleted')
ALTER TABLE {databaseOwner}{objectQualifier}Store_Products ADD
- IsDeleted bit NOT NULL CONSTRAINT DF_Store_Products_IsDeleted DEFAULT 0
+ IsDeleted bit NOT NULL CONSTRAINT DF_{objectQualifier}Store_Products_IsDeleted DEFAULT 0
GO
ALTER PROCEDURE {databaseOwner}{objectQualifier}Store_Products_DeleteProduct
Index: 02.00.06.SqlDataProvider
===================================================================
--- 02.00.06.SqlDataProvider (revision 53)
+++ 02.00.06.SqlDataProvider (working copy)
@@ -65,9 +65,9 @@
GO
ALTER TABLE {databaseOwner}{objectQualifier}Store_Products
- ADD ProductHeight DECIMAL(10, 2) not null CONSTRAINT [DF_Store_Products_ProductHeight] DEFAULT (1),
- ProductLength DECIMAL(10, 2) not null CONSTRAINT [DF_Store_Products_ProductLength] DEFAULT (1),
- ProductWidth DECIMAL(10, 2) not null CONSTRAINT [DF_Store_Products_ProductProductWidth] DEFAULT (1);
+ ADD ProductHeight DECIMAL(10, 2) not null CONSTRAINT [DF_{objectQualifier}Store_Products_ProductHeight] DEFAULT (1),
+ ProductLength DECIMAL(10, 2) not null CONSTRAINT [DF_{objectQualifier}Store_Products_ProductLength] DEFAULT (1),
+ ProductWidth DECIMAL(10, 2) not null CONSTRAINT [DF_{objectQualifier}Store_Products_ProductProductWidth] DEFAULT (1);
GO
ALTER PROCEDURE {databaseOwner}{objectQualifier}Store_Products_AddProduct