mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Swtich to SqlCe provider for local database
--HG-- branch : dev
This commit is contained in:
@@ -77,7 +77,7 @@ namespace Orchard.Core.Settings.DataMigrations {
|
|||||||
//CREATE TABLE Settings_ShellStateRecord (Id integer, primary key (Id));
|
//CREATE TABLE Settings_ShellStateRecord (Id integer, primary key (Id));
|
||||||
SchemaBuilder.CreateTable("ShellStateRecord", table => table
|
SchemaBuilder.CreateTable("ShellStateRecord", table => table
|
||||||
.Column<int>("Id", column => column.PrimaryKey().Identity())
|
.Column<int>("Id", column => column.PrimaryKey().Identity())
|
||||||
.Column<string>("Name")
|
.Column<string>("Unused")
|
||||||
);
|
);
|
||||||
|
|
||||||
//CREATE TABLE Settings_SiteSettingsRecord (Id INTEGER not null, SiteSalt TEXT, SiteName TEXT, SuperUser TEXT, PageTitleSeparator TEXT, HomePage TEXT, SiteCulture TEXT, primary key (Id));
|
//CREATE TABLE Settings_SiteSettingsRecord (Id INTEGER not null, SiteSalt TEXT, SiteName TEXT, SuperUser TEXT, PageTitleSeparator TEXT, HomePage TEXT, SiteCulture TEXT, primary key (Id));
|
||||||
|
|||||||
@@ -4,10 +4,18 @@ using Orchard.Data.Conventions;
|
|||||||
namespace Orchard.Core.Settings.State.Records {
|
namespace Orchard.Core.Settings.State.Records {
|
||||||
public class ShellStateRecord {
|
public class ShellStateRecord {
|
||||||
public ShellStateRecord() {
|
public ShellStateRecord() {
|
||||||
Features = new List<ShellFeatureStateRecord>(); }
|
Features = new List<ShellFeatureStateRecord>();
|
||||||
|
}
|
||||||
|
|
||||||
public virtual int Id { get; set; }
|
public virtual int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Workaround SqlCe: There is apparently no way to insert a row in a table with a single column IDENTITY ID primary key.
|
||||||
|
/// See: http://www.sqldev.org/transactsql/insert-only-identity-column-value-in-sql-compact-edition-95267.shtml
|
||||||
|
/// So we added this "Unused" column.
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Unused { get; set; }
|
||||||
|
|
||||||
[CascadeAllDeleteOrphan]
|
[CascadeAllDeleteOrphan]
|
||||||
public virtual IList<ShellFeatureStateRecord> Features { get; set; }
|
public virtual IList<ShellFeatureStateRecord> Features { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace Orchard.Setup.Controllers {
|
|||||||
SiteName = model.SiteName,
|
SiteName = model.SiteName,
|
||||||
AdminUsername = model.AdminUsername,
|
AdminUsername = model.AdminUsername,
|
||||||
AdminPassword = model.AdminPassword,
|
AdminPassword = model.AdminPassword,
|
||||||
DatabaseProvider = model.DatabaseOptions ? "SQLite" : "SqlServer",
|
DatabaseProvider = model.DatabaseOptions ? "SqlCe" : "SqlServer",
|
||||||
DatabaseConnectionString = model.DatabaseConnectionString,
|
DatabaseConnectionString = model.DatabaseConnectionString,
|
||||||
DatabaseTablePrefix = model.DatabaseTablePrefix,
|
DatabaseTablePrefix = model.DatabaseTablePrefix,
|
||||||
EnabledFeatures = null // default list
|
EnabledFeatures = null // default list
|
||||||
|
|||||||
Reference in New Issue
Block a user