mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-22 03:37:25 +08:00
Use DataMigration API to create database tables for each feature
--HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Orchard.Data.Migration;
|
||||
|
||||
namespace Orchard.Themes.DataMigrations {
|
||||
public class ThemesDataMigration : DataMigrationImpl {
|
||||
|
||||
public int Create() {
|
||||
//CREATE TABLE Orchard_Themes_ThemeRecord (Id INTEGER not null, ThemeName TEXT, DisplayName TEXT, Description TEXT, Version TEXT, Author TEXT, HomePage TEXT, Tags TEXT, primary key (Id));
|
||||
SchemaBuilder.CreateTable("ThemeRecord", table => table
|
||||
.Column<int>("Id", column => column.PrimaryKey())
|
||||
.Column<string>("ThemeName")
|
||||
.Column<string>("DisplayName")
|
||||
.Column<string>("Description")
|
||||
.Column<string>("Version")
|
||||
.Column<string>("Author")
|
||||
.Column<string>("HomePage")
|
||||
.Column<string>("Tags")
|
||||
);
|
||||
|
||||
//CREATE TABLE Orchard_Themes_ThemeSiteSettingsRecord (Id INTEGER not null, CurrentThemeName TEXT, primary key (Id));
|
||||
SchemaBuilder.CreateTable("ThemeSiteSettingsRecord", table => table
|
||||
.Column<int>("Id", column => column.PrimaryKey())
|
||||
.Column<string>("CurrentThemeName")
|
||||
);
|
||||
|
||||
return 0010;
|
||||
}
|
||||
}
|
||||
}
|
@@ -67,6 +67,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="DataMigrations\ThemesDataMigration.cs" />
|
||||
<Compile Include="DesignerNotes\ZoneManagerEvents.cs" />
|
||||
<Compile Include="Handlers\ThemeSiteSettingsHandler.cs" />
|
||||
<Compile Include="Models\Theme.cs" />
|
||||
|
Reference in New Issue
Block a user