Skip to content

Commit

Permalink
initial git commit of suteki shop at version 2.2.0.514
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehadlow committed Apr 19, 2012
0 parents commit 39e4e7a
Show file tree
Hide file tree
Showing 1,269 changed files with 410,041 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
@@ -0,0 +1,12 @@
[Oo]bj
[Bb]in
*.user
*.suo
*.[Cc]ache
*.bak
*.ncb
*.log
*.DS_Store
[Tt]humbs.db
_ReSharper.*
*.svn
Binary file added Administration/UpgrateDependencies.ps1
Binary file not shown.
5 changes: 5 additions & 0 deletions Build.bat
@@ -0,0 +1,5 @@
@echo off
pushd Suteki.Shop
nant\nant.exe
popd
pause
5 changes: 5 additions & 0 deletions CompileViews.bat
@@ -0,0 +1,5 @@
@echo off
pushd Suteki.Shop
nant\nant.exe compile-views
popd
pause
Binary file added Database/001_create_database.sql
Binary file not shown.
58 changes: 58 additions & 0 deletions Database/002_insert_static_data.sql
@@ -0,0 +1,58 @@
use SutekiShop


insert [role] (RoleId, [Name]) values(1, 'Administrator')
insert [role] (RoleId, [Name]) values(2, 'Order Processor')
insert [role] (RoleId, [Name]) values(3, 'Customer')
insert [role] (RoleId, [Name]) values(4, 'Guest')

insert [user] (Email, [Password], RoleId, IsEnabled)
values('admin@sutekishop.co.uk', 'D033E22AE348AEB5660FC2140AEC35850C4DA997', 1, 1)

set identity_insert category on
insert category (CategoryId, [Name], ParentId, Position, IsActive) values(1, '- Root', null, 1, 1)
set identity_insert category off

insert CardType values(1, 'Visa / Delta / Electron', 0)
insert CardType values(2, 'Master Card / Euro Card', 0)
insert CardType values(3, 'American Express', 0)
insert CardType values(4, 'Switch / Solo / Maestro', 1)

insert OrderStatus values(1, 'Created')
insert OrderStatus values(2, 'Dispatched')
insert OrderStatus values(3, 'Rejected')

insert ContentType values(1, 'Menu')
insert ContentType values(2, 'Text')
insert ContentType values(3, 'Action')
insert ContentType values(4, 'Top')

set identity_insert [content] on

insert [content](contentId, parentContentId, contentTypeId, [name], UrlName, [text], controller, [action], position, isActive)
values(1, null, 1, 'Main Menu', 'Main_menu', null, null, null, 1, 1)

insert [content](contentId, parentContentId, contentTypeId, [name], UrlName, [text], controller, [action], position, isActive)
values(2, 1, 4, 'Home', 'Home', 'Homepage Content', null, null, 2, 1)

insert [content](contentId, parentContentId, contentTypeId, [name], UrlName, [text], controller, [action], position, isActive)
values(3, 1, 3, 'Online Shop', 'Online_Shop', null, 'Home', 'Index', 3, 1)

insert [content](contentId, parentContentId, contentTypeId, [name], UrlName, [text], controller, [action], position, isActive)
values(4, null, 2, 'Shopfront', 'Shopfront', '<h1>Wecome to our online shop</h1>', null, null, 4, 1)

set identity_insert [content] off

set identity_insert PostZone on

insert PostZone (PostZoneId, [Name], Multiplier, AskIfMaxWeight, Position, IsActive, FlatRate)
values(1, 'United Kingdom', 1, 0, 1, 1, 10)

set identity_insert PostZone off

set identity_insert [Country] on

insert [Country] (CountryId, [Name], Position, IsActive, PostZoneId)
values(1, 'United Kingdom', 1, 1, 1)

set identity_insert [Country] off
3 changes: 3 additions & 0 deletions Database/003_Add_notes_to_order.sql
@@ -0,0 +1,3 @@
use SutekiShop
ALTER TABLE dbo.[Order]
ADD Note nvarchar(1000) NULL
3 changes: 3 additions & 0 deletions Database/004_Add_CategoryImage.sql
@@ -0,0 +1,3 @@
use SutekiShop
alter table Category
ADD ImageId int
3 changes: 3 additions & 0 deletions Database/005_Add_ContactMe_To_Order.sql
@@ -0,0 +1,3 @@
use SutekiShop
ALTER TABLE dbo.[Order] ADD
ContactMe bit NOT NULL CONSTRAINT DF_Order_ContactMe DEFAULT 0
41 changes: 41 additions & 0 deletions Database/006_Change_products_to_have_many_categories.sql
@@ -0,0 +1,41 @@
use SutekiShop
create table ProductCategory (
Id int not null identity(1, 1),
ProductId int not null,
CategoryId int not null
) ON [PRIMARY]

ALTER TABLE ProductCategory ADD CONSTRAINT PK_ProductCategory PRIMARY KEY CLUSTERED (
Id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

insert into ProductCategory (ProductId, CategoryId)
select ProductId, CategoryId from Product

ALTER TABLE dbo.ProductCategory ADD CONSTRAINT
FK_ProductCategory_Category FOREIGN KEY
(
CategoryId
) REFERENCES dbo.Category
(
CategoryId
) ON UPDATE NO ACTION
ON DELETE NO ACTION


ALTER TABLE dbo.ProductCategory ADD CONSTRAINT
FK_ProductCategory_Product FOREIGN KEY
(
ProductId
) REFERENCES dbo.Product
(
ProductId
) ON UPDATE NO ACTION
ON DELETE NO ACTION


alter table Product
drop constraint FK_Product_Category

alter table Product
drop column CategoryId
3 changes: 3 additions & 0 deletions Database/007_Add_pending_status.sql
@@ -0,0 +1,3 @@
use SutekiShop
insert into OrderStatus (OrderStatusId, Name)
VALUES (0, 'Pending')
14 changes: 14 additions & 0 deletions Database/008_Add_Reviews.sql
@@ -0,0 +1,14 @@
use SutekiShop
CREATE TABLE dbo.Review (
Id int NOT NULL IDENTITY (1, 1),
ProductId int NOT NULL,
Approved bit NOT NULL,
[Text] nvarchar(MAX) NULL,
Reviewer nvarchar(250),
Rating int
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]

ALTER TABLE dbo.Review ADD CONSTRAINT PK_Review PRIMARY KEY CLUSTERED (
Id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
34 changes: 34 additions & 0 deletions Database/009_Add_MailingListSubscriptions.sql
@@ -0,0 +1,34 @@
use SutekiShop
GO
CREATE TABLE dbo.MailingListSubscription
(
Id int NOT NULL IDENTITY (1, 1),
ContactId int NOT NULL,
Email nvarchar(250) NOT NULL,
DateSubscribed datetime NOT NULL CONSTRAINT DF_MailingListSubscription_DateSubscribed DEFAULT getdate()
) ON [PRIMARY]
GO
ALTER TABLE dbo.MailingListSubscription ADD CONSTRAINT
PK_MailingListSubscription PRIMARY KEY CLUSTERED
(
Id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO

ALTER TABLE dbo.MailingListSubscription ADD CONSTRAINT
FK_MailingListSubscription_Contact FOREIGN KEY
(
ContactId
) REFERENCES dbo.Contact
(
ContactId
) ON UPDATE NO ACTION
ON DELETE NO ACTION

GO

IF NOT EXISTS(select * from Content where Name = 'Mailing List')
INSERT INTO Content (ParentContentId, ContentTypeId, Name, UrlName, Controller, Action, IsActive, Position)
VALUES (1, 3, 'Mailing List', 'Mailing_List', 'MailingList', 'Index', 1, 20)
GO
20 changes: 20 additions & 0 deletions Database/010_Update_For_NH_changes.sql
@@ -0,0 +1,20 @@

-- update db for NH changes
use SutekiShop

alter table [Content]
add ContentType varchar(50)
go
update [Content] set ContentType = 'Menu' where ContentTypeId = 1
update [Content] set ContentType = 'TextContent' where ContentTypeId = 2
update [Content] set ContentType = 'ActionContent' where ContentTypeId = 3
update [Content] set ContentType = 'TopContent' where ContentTypeId = 4

exec sp_rename 'ProductCategory.Id', 'ProductCategoryId'
go
exec sp_rename 'Review.Id', 'ReviewId'
go
exec sp_rename 'MailingListSubscription.Id', 'MailingListSubscriptionId'
go


Binary file not shown.
16 changes: 16 additions & 0 deletions Database/012_Update_orderLines_with_productUrlName.sql
@@ -0,0 +1,16 @@
alter table OrderLine
add ProductUrlName nvarchar(255) null

update OrderLine set ProductUrlName = ''

update OrderLine set ProductUrlName = p.UrlName
from OrderLine l
join Product p on SUBSTRING(l.ProductName, 0, CHARINDEX(' - ', l.ProductName, 0)) = p.Name

update OrderLine set ProductUrlName = p.UrlName
from OrderLine l
join Product p on l.ProductName = p.Name

update OrderLine set ProductUrlName = p.UrlName
from OrderLine l
join Product p on SUBSTRING(l.ProductName, 0, CHARINDEX(' - ', l.ProductName, CHARINDEX(' - ', l.ProductName, 0)+1)) = p.Name
Binary file not shown.

0 comments on commit 39e4e7a

Please sign in to comment.