-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed \upgradescripts\2.65-2.70(upcoming) directory to \upgradescri…
…pts\2.65-2.70
- Loading branch information
andreymaz
committed
Nov 29, 2012
1 parent
7ae0362
commit 2ac114a
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Steps: | ||
1. Backup your existing database | ||
2. Execute upgrade.sql script over your database | ||
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt | ||
4. Upload new site files | ||
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files | ||
6. Ensure that everything is OK | ||
|
||
Notes: | ||
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--upgrade scripts from nopCommerce 2.70 to nopCommerce 2.80 | ||
|
||
--new locale resources | ||
declare @resources xml | ||
--a resource will be delete if its value is empty | ||
set @resources=' | ||
<Language> | ||
<LocaleResource Name=""> | ||
<Value></Value> | ||
</LocaleResource> | ||
</Language> | ||
' | ||
|
||
CREATE TABLE #LocaleStringResourceTmp | ||
( | ||
[ResourceName] [nvarchar](200) NOT NULL, | ||
[ResourceValue] [nvarchar](max) NOT NULL | ||
) | ||
|
||
INSERT INTO #LocaleStringResourceTmp (ResourceName, ResourceValue) | ||
SELECT nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)') | ||
FROM @resources.nodes('//Language/LocaleResource') AS R(nref) | ||
|
||
--do it for each existing language | ||
DECLARE @ExistingLanguageID int | ||
DECLARE cur_existinglanguage CURSOR FOR | ||
SELECT [ID] | ||
FROM [Language] | ||
OPEN cur_existinglanguage | ||
FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageID | ||
WHILE @@FETCH_STATUS = 0 | ||
BEGIN | ||
DECLARE @ResourceName nvarchar(200) | ||
DECLARE @ResourceValue nvarchar(MAX) | ||
DECLARE cur_localeresource CURSOR FOR | ||
SELECT ResourceName, ResourceValue | ||
FROM #LocaleStringResourceTmp | ||
OPEN cur_localeresource | ||
FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue | ||
WHILE @@FETCH_STATUS = 0 | ||
BEGIN | ||
IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName)) | ||
BEGIN | ||
UPDATE [LocaleStringResource] | ||
SET [ResourceValue]=@ResourceValue | ||
WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName | ||
END | ||
ELSE | ||
BEGIN | ||
INSERT INTO [LocaleStringResource] | ||
( | ||
[LanguageId], | ||
[ResourceName], | ||
[ResourceValue] | ||
) | ||
VALUES | ||
( | ||
@ExistingLanguageID, | ||
@ResourceName, | ||
@ResourceValue | ||
) | ||
END | ||
|
||
IF (@ResourceValue is null or @ResourceValue = '') | ||
BEGIN | ||
DELETE [LocaleStringResource] | ||
WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName | ||
END | ||
|
||
FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue | ||
END | ||
CLOSE cur_localeresource | ||
DEALLOCATE cur_localeresource | ||
|
||
|
||
--fetch next language identifier | ||
FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageID | ||
END | ||
CLOSE cur_existinglanguage | ||
DEALLOCATE cur_existinglanguage | ||
|
||
DROP TABLE #LocaleStringResourceTmp | ||
GO | ||
|
||
|
||
|
||
|