mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 09:44:20 +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));
|
||||
SchemaBuilder.CreateTable("ShellStateRecord", table => table
|
||||
.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));
|
||||
|
@@ -4,10 +4,18 @@ using Orchard.Data.Conventions;
|
||||
namespace Orchard.Core.Settings.State.Records {
|
||||
public class ShellStateRecord {
|
||||
public ShellStateRecord() {
|
||||
Features = new List<ShellFeatureStateRecord>(); }
|
||||
Features = new List<ShellFeatureStateRecord>();
|
||||
}
|
||||
|
||||
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]
|
||||
public virtual IList<ShellFeatureStateRecord> Features { get; set; }
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ namespace Orchard.Setup.Controllers {
|
||||
SiteName = model.SiteName,
|
||||
AdminUsername = model.AdminUsername,
|
||||
AdminPassword = model.AdminPassword,
|
||||
DatabaseProvider = model.DatabaseOptions ? "SQLite" : "SqlServer",
|
||||
DatabaseProvider = model.DatabaseOptions ? "SqlCe" : "SqlServer",
|
||||
DatabaseConnectionString = model.DatabaseConnectionString,
|
||||
DatabaseTablePrefix = model.DatabaseTablePrefix,
|
||||
EnabledFeatures = null // default list
|
||||
|
Reference in New Issue
Block a user