mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : mvc3p1
This commit is contained in:
@@ -50,7 +50,6 @@ namespace Orchard.Tests.DataMigration {
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty<RecordBlueprint>() }).As<ShellBlueprint>();
|
||||
builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST_" }).As<ShellSettings>();
|
||||
builder.RegisterType<SqlCeCommandInterpreter>().As<ICommandInterpreter>();
|
||||
builder.RegisterModule(new DataModule());
|
||||
_container = builder.Build();
|
||||
|
||||
@@ -153,8 +152,8 @@ namespace Orchard.Tests.DataMigration {
|
||||
.Column("City", DbType.String)
|
||||
.Column("ZIP", DbType.Int32, column => column.Unique())
|
||||
.Column("UserId", DbType.Int32, column => column.NotNull()))
|
||||
.CreateForeignKey("User_Address", "User", new[] { "UserId" }, "User", new[] { "Id" })
|
||||
.DropForeignKey("User", "User_Address");
|
||||
.CreateForeignKey("FK_User", "Address", new[] { "UserId" }, "User", new[] { "Id" })
|
||||
.DropForeignKey("Address", "FK_User");
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ using System.Xml.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Feeds.Models;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Core.Feeds.StandardBuilders {
|
||||
[UsedImplicitly]
|
||||
@@ -36,15 +37,25 @@ namespace Orchard.Core.Feeds.StandardBuilders {
|
||||
|
||||
context.Response.Contextualize(requestContext => {
|
||||
var urlHelper = new UrlHelper(requestContext, _routes);
|
||||
link.Add(urlHelper.RouteUrl(inspector.Link));
|
||||
guid.Add(urlHelper.RouteUrl(inspector.Link));
|
||||
var uriBuilder = new UriBuilder(urlHelper.RequestContext.HttpContext.Request.ToRootUrlString()) { Path = urlHelper.RouteUrl(inspector.Link) };
|
||||
link.Add(uriBuilder.Uri.OriginalString);
|
||||
guid.Add(uriBuilder.Uri.OriginalString);
|
||||
});
|
||||
|
||||
feedItem.Element.SetElementValue("title", inspector.Title);
|
||||
feedItem.Element.Add(link);
|
||||
feedItem.Element.SetElementValue("description", inspector.Description);
|
||||
if (inspector.PublishedUtc != null)
|
||||
feedItem.Element.SetElementValue("pubDate", inspector.PublishedUtc);//TODO: format
|
||||
|
||||
if ( inspector.PublishedUtc != null ) {
|
||||
// RFC833
|
||||
// The "R" or "r" standard format specifier represents a custom date and time format string that is defined by
|
||||
// the DateTimeFormatInfo.RFC1123Pattern property. The pattern reflects a defined standard, and the property
|
||||
// is read-only. Therefore, it is always the same, regardless of the culture used or the format provider supplied.
|
||||
// The custom format string is "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'". When this standard format specifier is used,
|
||||
// the formatting or parsing operation always uses the invariant culture.
|
||||
feedItem.Element.SetElementValue("pubDate", inspector.PublishedUtc.Value.ToString("r"));
|
||||
}
|
||||
|
||||
feedItem.Element.Add(guid);
|
||||
}
|
||||
else {
|
||||
|
@@ -140,9 +140,8 @@
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<UseCustomServer>True</UseCustomServer>
|
||||
<CustomServerUrl>http://orchard.codeplex.com</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
|
@@ -1,4 +1,9 @@
|
||||
using System.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.MetaData.Builders;
|
||||
using Orchard.Core.Contents.Extensions;
|
||||
using Orchard.Data.Migration;
|
||||
|
||||
namespace $$FeatureName$$.DataMigrations {
|
||||
|
@@ -186,7 +186,7 @@ namespace Orchard.Data.Migration.Interpreters {
|
||||
|
||||
builder.AppendFormat("alter table {0} alter column {1} ",
|
||||
_dialect.QuoteForTableName(PrefixTableName(command.TableName)),
|
||||
_dialect.QuoteForColumnName(command.TableName));
|
||||
_dialect.QuoteForColumnName(command.ColumnName));
|
||||
|
||||
// type
|
||||
if (command.DbType != DbType.Object) {
|
||||
@@ -195,7 +195,7 @@ namespace Orchard.Data.Migration.Interpreters {
|
||||
|
||||
// [default value]
|
||||
if (!string.IsNullOrEmpty(command.Default)) {
|
||||
builder.Append(" default ").Append(command.Default).Append(Space);
|
||||
builder.Append(" set default ").Append(command.Default).Append(Space);
|
||||
}
|
||||
_sqlStatements.Add(builder.ToString());
|
||||
}
|
||||
@@ -250,7 +250,7 @@ namespace Orchard.Data.Migration.Interpreters {
|
||||
|
||||
builder.Append(_dialect.GetAddForeignKeyConstraintString(command.Name,
|
||||
command.SrcColumns,
|
||||
command.DestTable,
|
||||
_dialect.QuoteForTableName(PrefixTableName(command.DestTable)),
|
||||
command.DestColumns,
|
||||
false));
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace Orchard.Data.Migration.Interpreters {
|
||||
|
||||
var builder = new StringBuilder();
|
||||
|
||||
builder.AppendFormat("alter table {0} drop constraint {1}", command.SrcTable, command.Name);
|
||||
builder.AppendFormat("alter table {0} drop constraint {1}", _dialect.QuoteForTableName(PrefixTableName(command.SrcTable)), command.Name);
|
||||
_sqlStatements.Add(builder.ToString());
|
||||
|
||||
RunPendingStatements();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using Orchard.Data.Migration.Schema;
|
||||
|
||||
namespace Orchard.Data.Migration.Interpreters {
|
||||
public class SqlCeCommandInterpreter :
|
||||
public class SQLiteCommandInterpreter :
|
||||
ICommandInterpreter<DropColumnCommand>,
|
||||
ICommandInterpreter<AlterColumnCommand>,
|
||||
ICommandInterpreter<CreateForeignKeyCommand>,
|
||||
@@ -34,7 +34,7 @@ namespace Orchard.Data.Migration.Interpreters {
|
||||
}
|
||||
|
||||
public string DataProvider {
|
||||
get { return "SqlCe"; }
|
||||
get { return "SQLite"; }
|
||||
}
|
||||
}
|
||||
}
|
@@ -390,7 +390,7 @@
|
||||
<Compile Include="Data\Migration\Interpreters\ICommandInterpreter.cs" />
|
||||
<Compile Include="Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs" />
|
||||
<Compile Include="Data\Migration\Interpreters\IDataMigrationInterpreter.cs" />
|
||||
<Compile Include="Data\Migration\Interpreters\SqlCeCommandInterpreter.cs" />
|
||||
<Compile Include="Data\Migration\Interpreters\SQLiteCommandInterpreter.cs" />
|
||||
<Compile Include="Data\Migration\Interpreters\StringCommandInterpreter.cs" />
|
||||
<Compile Include="Data\Migration\Schema\AddColumnCommand.cs" />
|
||||
<Compile Include="Data\Migration\Schema\ISchemaBuilderCommand.cs" />
|
||||
|
Reference in New Issue
Block a user