mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Use DataMigration API to create database tables for each feature
--HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Orchard.Data.Migration;
|
||||
|
||||
namespace Orchard.Blogs.DataMigrations {
|
||||
public class BlogsDataMigration : DataMigrationImpl {
|
||||
|
||||
public int Create() {
|
||||
//CREATE TABLE Orchard_Blogs_BlogArchiveRecord (Id integer, Year INTEGER, Month INTEGER, PostCount INTEGER, Blog_id INTEGER, primary key (Id));
|
||||
SchemaBuilder.CreateTable("BlogArchiveRecord", table => table
|
||||
.Column<int>("Id", column => column.PrimaryKey())
|
||||
.Column<int>("Year")
|
||||
.Column<int>("Month")
|
||||
.Column<int>("PostCount")
|
||||
.Column<int>("Blog_id")
|
||||
);
|
||||
|
||||
//CREATE TABLE Orchard_Blogs_BlogRecord (Id INTEGER not null, Description TEXT, PostCount INTEGER, primary key (Id));
|
||||
SchemaBuilder.CreateTable("BlogRecord", table => table
|
||||
.Column<int>("Id", column => column.PrimaryKey())
|
||||
.Column<string>("Description")
|
||||
.Column<int>("PostCount")
|
||||
);
|
||||
|
||||
return 0010;
|
||||
}
|
||||
}
|
||||
}
|
@@ -68,6 +68,7 @@
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Commands\BlogCommands.cs" />
|
||||
<Compile Include="Controllers\BlogAdminController.cs" />
|
||||
<Compile Include="DataMigrations\BlogsDataMigration.cs" />
|
||||
<Compile Include="Drivers\BlogDriver.cs" />
|
||||
<Compile Include="Controllers\BlogPostAdminController.cs" />
|
||||
<Compile Include="Controllers\BlogPostController.cs" />
|
||||
|
Reference in New Issue
Block a user