mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,8 +1,21 @@
|
|||||||
<div class="sections">
|
<div class="edit-item">
|
||||||
<div class="primary">
|
<div class="edit-item-primary">
|
||||||
@Display(Model.Content)
|
@if (Model.Content != null) {
|
||||||
|
<div class="edit-item-content">
|
||||||
|
@Display(Model.Content)
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="secondary">
|
<div class="edit-item-secondary">
|
||||||
@Display(Model.Sidebar)
|
@if (Model.Actions != null) {
|
||||||
|
<div class="edit-item-actions">
|
||||||
|
@Display(Model.Actions)
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (Model.Sidebar != null) {
|
||||||
|
<div class="edit-item-sidebar">
|
||||||
|
@Display(Model.Sidebar)
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
using Orchard.ContentManagement.Drivers;
|
using Orchard.ContentManagement.Drivers;
|
||||||
using Orchard.ContentManagement.MetaData;
|
using Orchard.ContentManagement.MetaData;
|
||||||
using Orchard.ContentManagement.MetaData.Builders;
|
using Orchard.ContentManagement.MetaData.Builders;
|
||||||
@@ -7,7 +8,7 @@ using Orchard.Core.Contents.Extensions;
|
|||||||
using Orchard.Data.Migration;
|
using Orchard.Data.Migration;
|
||||||
|
|
||||||
namespace $$FeatureName$$.DataMigrations {
|
namespace $$FeatureName$$.DataMigrations {
|
||||||
public class Migration : DataMigrationImpl {
|
public class Migrations : DataMigrationImpl {
|
||||||
|
|
||||||
public int Create() {
|
public int Create() {
|
||||||
$$Commands$$
|
$$Commands$$
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<ProductVersion>9.0.30729</ProductVersion>
|
<ProductVersion>9.0.30729</ProductVersion>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{$$ModuleProjectGuid$$}</ProjectGuid>
|
<ProjectGuid>{$$ModuleProjectGuid$$}</ProjectGuid>
|
||||||
<ProjectTypeGuids>{F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>$$ModuleName$$</RootNamespace>
|
<RootNamespace>$$ModuleName$$</RootNamespace>
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||||
|
@@ -61,7 +61,7 @@ namespace Orchard.CodeGeneration.Commands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string dataMigrationFolderPath = HostingEnvironment.MapPath("~/Modules/" + extensionDescriptor.Name + "/");
|
string dataMigrationFolderPath = HostingEnvironment.MapPath("~/Modules/" + extensionDescriptor.Name + "/");
|
||||||
string dataMigrationFilePath = dataMigrationFolderPath + "Migration.cs";
|
string dataMigrationFilePath = dataMigrationFolderPath + "Migrations.cs";
|
||||||
string templatesPath = HostingEnvironment.MapPath("~/Modules/Orchard." + ModuleName + "/CodeGenerationTemplates/");
|
string templatesPath = HostingEnvironment.MapPath("~/Modules/Orchard." + ModuleName + "/CodeGenerationTemplates/");
|
||||||
string moduleCsProjPath = HostingEnvironment.MapPath(string.Format("~/Modules/{0}/{0}.csproj", extensionDescriptor.Name));
|
string moduleCsProjPath = HostingEnvironment.MapPath(string.Format("~/Modules/{0}/{0}.csproj", extensionDescriptor.Name));
|
||||||
|
|
||||||
@@ -93,11 +93,11 @@ namespace Orchard.CodeGeneration.Commands {
|
|||||||
|
|
||||||
// The string searches in solution/project files can be made aware of comment lines.
|
// The string searches in solution/project files can be made aware of comment lines.
|
||||||
if ( projectFileText.Contains("<Compile Include") ) {
|
if ( projectFileText.Contains("<Compile Include") ) {
|
||||||
string compileReference = string.Format("<Compile Include=\"{0}\" />\r\n ", "DataMigrations\\" + extensionDescriptor.DisplayName + "DataMigration.cs");
|
string compileReference = string.Format("<Compile Include=\"{0}\" />\r\n ", "Migrations.cs");
|
||||||
projectFileText = projectFileText.Insert(projectFileText.LastIndexOf("<Compile Include"), compileReference);
|
projectFileText = projectFileText.Insert(projectFileText.LastIndexOf("<Compile Include"), compileReference);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
string itemGroupReference = string.Format("</ItemGroup>\r\n <ItemGroup>\r\n <Compile Include=\"{0}\" />\r\n ", "DataMigrations\\" + extensionDescriptor.DisplayName + "DataMigration.cs");
|
string itemGroupReference = string.Format("</ItemGroup>\r\n <ItemGroup>\r\n <Compile Include=\"{0}\" />\r\n ", "Migrations.cs");
|
||||||
projectFileText = projectFileText.Insert(projectFileText.LastIndexOf("</ItemGroup>"), itemGroupReference);
|
projectFileText = projectFileText.Insert(projectFileText.LastIndexOf("</ItemGroup>"), itemGroupReference);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,6 +302,7 @@ namespace Orchard.CodeGeneration.Commands {
|
|||||||
// include in solution but dont create a project: just add the references to Orchard.Themes project
|
// include in solution but dont create a project: just add the references to Orchard.Themes project
|
||||||
var itemGroup = CreateProjectItemGroup(HostingEnvironment.MapPath("~/Themes/"), createdFiles, createdFolders);
|
var itemGroup = CreateProjectItemGroup(HostingEnvironment.MapPath("~/Themes/"), createdFiles, createdFolders);
|
||||||
AddFilesToOrchardThemesProject(output, itemGroup);
|
AddFilesToOrchardThemesProject(output, itemGroup);
|
||||||
|
TouchSolution(output);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// create a project (already done) and add it to the solution
|
// create a project (already done) and add it to the solution
|
||||||
|
@@ -7,7 +7,6 @@ using Orchard.Core.Contents.Controllers;
|
|||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.UI.Admin;
|
using Orchard.UI.Admin;
|
||||||
using Orchard.UI.Notify;
|
using Orchard.UI.Notify;
|
||||||
using Orchard.UI.Widgets;
|
|
||||||
using Orchard.Widgets.Models;
|
using Orchard.Widgets.Models;
|
||||||
using Orchard.Widgets.Services;
|
using Orchard.Widgets.Services;
|
||||||
using Orchard.Widgets.ViewModels;
|
using Orchard.Widgets.ViewModels;
|
||||||
@@ -20,16 +19,13 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
private const string NotAuthorizedManageWidgetsLabel = "Not authorized to manage widgets";
|
private const string NotAuthorizedManageWidgetsLabel = "Not authorized to manage widgets";
|
||||||
|
|
||||||
private readonly IWidgetsService _widgetsService;
|
private readonly IWidgetsService _widgetsService;
|
||||||
private readonly IRuleManager _ruleManager;
|
|
||||||
|
|
||||||
public AdminController(
|
public AdminController(
|
||||||
IOrchardServices services,
|
IOrchardServices services,
|
||||||
IWidgetsService widgetsService,
|
IWidgetsService widgetsService) {
|
||||||
IRuleManager ruleManager) {
|
|
||||||
|
|
||||||
Services = services;
|
Services = services;
|
||||||
_widgetsService = widgetsService;
|
_widgetsService = widgetsService;
|
||||||
_ruleManager = ruleManager;
|
|
||||||
|
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
}
|
}
|
||||||
@@ -179,8 +175,6 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
|
|
||||||
var model = Services.ContentManager.UpdateEditor(layerPart, this);
|
var model = Services.ContentManager.UpdateEditor(layerPart, this);
|
||||||
|
|
||||||
ValidateLayer(layerPart);
|
|
||||||
|
|
||||||
if (!ModelState.IsValid) {
|
if (!ModelState.IsValid) {
|
||||||
Services.TransactionManager.Cancel();
|
Services.TransactionManager.Cancel();
|
||||||
return View(model);
|
return View(model);
|
||||||
@@ -227,8 +221,6 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
|
|
||||||
var model = Services.ContentManager.UpdateEditor(layerPart, this);
|
var model = Services.ContentManager.UpdateEditor(layerPart, this);
|
||||||
|
|
||||||
ValidateLayer(layerPart);
|
|
||||||
|
|
||||||
if (!ModelState.IsValid) {
|
if (!ModelState.IsValid) {
|
||||||
Services.TransactionManager.Cancel();
|
Services.TransactionManager.Cancel();
|
||||||
return View(model);
|
return View(model);
|
||||||
@@ -339,27 +331,6 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
RedirectToAction("Index");
|
RedirectToAction("Index");
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ValidateLayer(LayerPart layer) {
|
|
||||||
if ( String.IsNullOrWhiteSpace(layer.LayerRule) ) {
|
|
||||||
layer.LayerRule = "true";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_widgetsService.GetLayers().Count(l => String.Equals(l.Name, layer.Name, StringComparison.InvariantCultureIgnoreCase)) > 1) { // the current layer counts for 1
|
|
||||||
ModelState.AddModelError("Name", T("A Layer with the same name already exists").Text);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
_ruleManager.Matches(layer.LayerRule);
|
|
||||||
}
|
|
||||||
catch ( Exception e ) {
|
|
||||||
ModelState.AddModelError("Description", T("The rule is not valid: {0}", e.Message).Text);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
||||||
return base.TryUpdateModel(model, prefix, includeProperties, excludeProperties);
|
return base.TryUpdateModel(model, prefix, includeProperties, excludeProperties);
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,31 @@
|
|||||||
using JetBrains.Annotations;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.ContentManagement.Drivers;
|
using Orchard.ContentManagement.Drivers;
|
||||||
|
using Orchard.Localization;
|
||||||
|
using Orchard.UI.Widgets;
|
||||||
using Orchard.Widgets.Models;
|
using Orchard.Widgets.Models;
|
||||||
|
using Orchard.Widgets.Services;
|
||||||
|
|
||||||
namespace Orchard.Widgets.Drivers {
|
namespace Orchard.Widgets.Drivers {
|
||||||
|
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class LayerPartDriver : ContentPartDriver<LayerPart> {
|
public class LayerPartDriver : ContentPartDriver<LayerPart> {
|
||||||
|
private readonly IRuleManager _ruleManager;
|
||||||
|
private readonly IWidgetsService _widgetsService;
|
||||||
|
|
||||||
|
public LayerPartDriver(
|
||||||
|
IRuleManager ruleManager,
|
||||||
|
IWidgetsService widgetsService) {
|
||||||
|
|
||||||
|
_ruleManager = ruleManager;
|
||||||
|
_widgetsService = widgetsService;
|
||||||
|
|
||||||
|
T = NullLocalizer.Instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Localizer T { get; set; }
|
||||||
|
|
||||||
protected override DriverResult Editor(LayerPart layerPart, dynamic shapeHelper) {
|
protected override DriverResult Editor(LayerPart layerPart, dynamic shapeHelper) {
|
||||||
return ContentShape("Parts_Widgets_LayerPart",
|
return ContentShape("Parts_Widgets_LayerPart",
|
||||||
@@ -14,7 +33,23 @@ namespace Orchard.Widgets.Drivers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(LayerPart layerPart, IUpdateModel updater, dynamic shapeHelper) {
|
protected override DriverResult Editor(LayerPart layerPart, IUpdateModel updater, dynamic shapeHelper) {
|
||||||
updater.TryUpdateModel(layerPart, Prefix, null, null);
|
if(updater.TryUpdateModel(layerPart, Prefix, null, null)) {
|
||||||
|
if ( String.IsNullOrWhiteSpace(layerPart.LayerRule) ) {
|
||||||
|
layerPart.LayerRule = "true";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( _widgetsService.GetLayers().Any(l => String.Equals(l.Name, layerPart.Name, StringComparison.InvariantCultureIgnoreCase))) {
|
||||||
|
updater.AddModelError("Name", T("A Layer with the same name already exists"));
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
_ruleManager.Matches(layerPart.LayerRule);
|
||||||
|
}
|
||||||
|
catch ( Exception e ) {
|
||||||
|
updater.AddModelError("Description", T("The rule is not valid: {0}", e.Message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Editor(layerPart, shapeHelper);
|
return Editor(layerPart, shapeHelper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -47,9 +47,8 @@ namespace Orchard.Widgets.Filters {
|
|||||||
IEnumerable<WidgetPart> widgetParts = _contentManager.Query<WidgetPart, WidgetPartRecord>().List();
|
IEnumerable<WidgetPart> widgetParts = _contentManager.Query<WidgetPart, WidgetPartRecord>().List();
|
||||||
IEnumerable<LayerPart> activeLayers = _contentManager.Query<LayerPart, LayerPartRecord>().List();
|
IEnumerable<LayerPart> activeLayers = _contentManager.Query<LayerPart, LayerPartRecord>().List();
|
||||||
|
|
||||||
List<int> activeLayerIds = new List<int>();
|
var activeLayerIds = new List<int>();
|
||||||
foreach (var activeLayer in activeLayers) {
|
foreach (var activeLayer in activeLayers) {
|
||||||
var context = workContext.HttpContext;
|
|
||||||
// ignore the rule if it fails to execute
|
// ignore the rule if it fails to execute
|
||||||
try {
|
try {
|
||||||
if (_ruleManager.Matches(activeLayer.Record.LayerRule)) {
|
if (_ruleManager.Matches(activeLayer.Record.LayerRule)) {
|
||||||
@@ -57,7 +56,7 @@ namespace Orchard.Widgets.Filters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e) {
|
catch(Exception e) {
|
||||||
Logger.Debug(e, T("An error occured during layer evaluation on: {0}", activeLayer.Name).Text);
|
Logger.Warning(e, T("An error occured during layer evaluation on: {0}", activeLayer.Name).Text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ body {
|
|||||||
h1,h2,h3,h4,h5,h6 { font-weight: normal;}
|
h1,h2,h3,h4,h5,h6 { font-weight: normal;}
|
||||||
|
|
||||||
h1 { font-size: 1.692em }
|
h1 { font-size: 1.692em }
|
||||||
h2, h2 span { font-size: 1.538em; }
|
h2 { font-size: 1.538em; }
|
||||||
h3 { font-size: 1.231em; }
|
h3 { font-size: 1.231em; }
|
||||||
h4 { font-size: 1.154em; }
|
h4 { font-size: 1.154em; }
|
||||||
h5 { font-size: 1.077em; }
|
h5 { font-size: 1.077em; }
|
||||||
@@ -482,7 +482,6 @@ label {
|
|||||||
}
|
}
|
||||||
label.forcheckbox {
|
label.forcheckbox {
|
||||||
display:inline;
|
display:inline;
|
||||||
line-height:1.8em;
|
|
||||||
}
|
}
|
||||||
.bulk-actions label, .bulk-items h3, label.sub {
|
.bulk-actions label, .bulk-items h3, label.sub {
|
||||||
display:inline;
|
display:inline;
|
||||||
@@ -618,7 +617,7 @@ input[type="submit"]:hover,input[type="reset"]:hover, input[type="button"]:hover
|
|||||||
background: -webkit-gradient(linear, 0 0, 0 100%, from(#ffac40), to(#f9760d));
|
background: -webkit-gradient(linear, 0 0, 0 100%, from(#ffac40), to(#f9760d));
|
||||||
background: -moz-linear-gradient(top, #ffac40, #f9760d);
|
background: -moz-linear-gradient(top, #ffac40, #f9760d);
|
||||||
}
|
}
|
||||||
input[type="submit"]:active, input[type="reset"]:active, input[type="button"]:active, button:active {
|
input[type="submit"]:active, input[type="reset"]:active, input[type="button"]:active, button:active, .buton:active, .button.primaryAction:active {
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
background: #62a9e2;
|
background: #62a9e2;
|
||||||
color:#fff;
|
color:#fff;
|
||||||
@@ -872,7 +871,7 @@ table .button {
|
|||||||
padding:1em;
|
padding:1em;
|
||||||
}
|
}
|
||||||
.orchard-media fieldset div, .settings fieldset div, .settings .button {
|
.orchard-media fieldset div, .settings fieldset div, .settings .button {
|
||||||
margin:1em 0 .5em;
|
margin:.5em 0;
|
||||||
}
|
}
|
||||||
.settings legend {
|
.settings legend {
|
||||||
margin:0 0 -.4em;
|
margin:0 0 -.4em;
|
||||||
@@ -890,7 +889,7 @@ fieldset.publish-later-datetime {
|
|||||||
min-width:13.6em;
|
min-width:13.6em;
|
||||||
padding-left:6px;
|
padding-left:6px;
|
||||||
padding-right:0;
|
padding-right:0;
|
||||||
width:68%;
|
width:50%;
|
||||||
}
|
}
|
||||||
fieldset.publish-later-datetime legend {
|
fieldset.publish-later-datetime legend {
|
||||||
display:none;
|
display:none;
|
||||||
|
@@ -188,7 +188,7 @@ namespace Orchard.Data.Migration {
|
|||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
foreach (var migration in migrations.OfType<DataMigrationImpl>()) {
|
foreach (var migration in migrations.OfType<DataMigrationImpl>()) {
|
||||||
migration.SchemaBuilder = new SchemaBuilder(_interpreter, migration.Feature.Descriptor.Name.Replace(".", "_") + "_");
|
migration.SchemaBuilder = new SchemaBuilder(_interpreter, migration.Feature.Descriptor.Name, (s) => s.Replace(".", "_") + "_");
|
||||||
migration.ContentDefinitionManager = _contentDefinitionManager;
|
migration.ContentDefinitionManager = _contentDefinitionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,28 +5,30 @@ namespace Orchard.Data.Migration.Schema {
|
|||||||
public class SchemaBuilder {
|
public class SchemaBuilder {
|
||||||
private readonly IDataMigrationInterpreter _interpreter;
|
private readonly IDataMigrationInterpreter _interpreter;
|
||||||
private readonly string _featurePrefix;
|
private readonly string _featurePrefix;
|
||||||
|
private readonly Func<string, string> _formatPrefix;
|
||||||
|
|
||||||
public SchemaBuilder(IDataMigrationInterpreter interpreter, string featurePrefix = null) {
|
public SchemaBuilder(IDataMigrationInterpreter interpreter, string featurePrefix = null, Func<string, string> formatPrefix = null) {
|
||||||
_interpreter = interpreter;
|
_interpreter = interpreter;
|
||||||
_featurePrefix = featurePrefix;
|
_featurePrefix = featurePrefix ?? String.Empty;
|
||||||
|
_formatPrefix = formatPrefix ?? (s => s ?? String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SchemaBuilder CreateTable(string name, Action<CreateTableCommand> table) {
|
public SchemaBuilder CreateTable(string name, Action<CreateTableCommand> table) {
|
||||||
var createTable = new CreateTableCommand(String.Concat(_featurePrefix, name));
|
var createTable = new CreateTableCommand(String.Concat(_formatPrefix(_featurePrefix), name));
|
||||||
table(createTable);
|
table(createTable);
|
||||||
Run(createTable);
|
Run(createTable);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SchemaBuilder AlterTable(string name, Action<AlterTableCommand> table) {
|
public SchemaBuilder AlterTable(string name, Action<AlterTableCommand> table) {
|
||||||
var alterTable = new AlterTableCommand(String.Concat(_featurePrefix, name));
|
var alterTable = new AlterTableCommand(String.Concat(_formatPrefix(_featurePrefix), name));
|
||||||
table(alterTable);
|
table(alterTable);
|
||||||
Run(alterTable);
|
Run(alterTable);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SchemaBuilder DropTable(string name) {
|
public SchemaBuilder DropTable(string name) {
|
||||||
var deleteTable = new DropTableCommand(String.Concat(_featurePrefix, name));
|
var deleteTable = new DropTableCommand(String.Concat(_formatPrefix(_featurePrefix), name));
|
||||||
Run(deleteTable);
|
Run(deleteTable);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -45,13 +47,37 @@ namespace Orchard.Data.Migration.Schema {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SchemaBuilder CreateForeignKey(string name, string srcTable, string[] srcColumns, string destTable, string[] destColumns) {
|
public SchemaBuilder CreateForeignKey(string name, string srcTable, string[] srcColumns, string destTable, string[] destColumns) {
|
||||||
var command = new CreateForeignKeyCommand(name, String.Concat(_featurePrefix, srcTable), srcColumns, String.Concat(_featurePrefix, destTable), destColumns);
|
var command = new CreateForeignKeyCommand(name, String.Concat(_formatPrefix(_featurePrefix), srcTable), srcColumns, String.Concat(_formatPrefix(_featurePrefix), destTable), destColumns);
|
||||||
|
Run(command);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SchemaBuilder CreateForeignKey(string name, string srcModule, string srcTable, string[] srcColumns, string destTable, string[] destColumns) {
|
||||||
|
var command = new CreateForeignKeyCommand(name, String.Concat(_formatPrefix(srcModule), srcTable), srcColumns, String.Concat(_formatPrefix(_featurePrefix), destTable), destColumns);
|
||||||
|
Run(command);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SchemaBuilder CreateForeignKey(string name, string srcTable, string[] srcColumns, string destModule, string destTable, string[] destColumns) {
|
||||||
|
var command = new CreateForeignKeyCommand(name, String.Concat(_formatPrefix(_featurePrefix), srcTable), srcColumns, String.Concat(_formatPrefix(destModule), destTable), destColumns);
|
||||||
|
Run(command);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SchemaBuilder CreateForeignKey(string name, string srcModule, string srcTable, string[] srcColumns, string destModule, string destTable, string[] destColumns) {
|
||||||
|
var command = new CreateForeignKeyCommand(name, String.Concat(_formatPrefix(srcModule), srcTable), srcColumns, String.Concat(_formatPrefix(destModule), destTable), destColumns);
|
||||||
Run(command);
|
Run(command);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SchemaBuilder DropForeignKey(string srcTable, string name) {
|
public SchemaBuilder DropForeignKey(string srcTable, string name) {
|
||||||
var command = new DropForeignKeyCommand(String.Concat(_featurePrefix, srcTable), name);
|
var command = new DropForeignKeyCommand(String.Concat(_formatPrefix(_featurePrefix), srcTable), name);
|
||||||
|
Run(command);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SchemaBuilder DropForeignKey(string srcModule, string srcTable, string name) {
|
||||||
|
var command = new DropForeignKeyCommand(String.Concat(_formatPrefix(srcModule), srcTable), name);
|
||||||
Run(command);
|
Run(command);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user