using System; using Orchard.Data.Migration; namespace Orchard.Comments.DataMigrations { public class CommentsDataMigration : DataMigrationImpl { public int Create() { //CREATE TABLE Orchard_Comments_ClosedCommentsRecord (Id integer, ContentItemId INTEGER, primary key (Id)); SchemaBuilder.CreateTable("ClosedCommentsRecord", table => table .Column("Id", column => column.PrimaryKey().Identity()) .Column("ContentItemId") ); //CREATE TABLE Orchard_Comments_CommentRecord (Id INTEGER not null, Author TEXT, SiteName TEXT, UserName TEXT, Email TEXT, Status TEXT, CommentDateUtc DATETIME, CommentText TEXT, CommentedOn INTEGER, CommentedOnContainer INTEGER, primary key (Id)); SchemaBuilder.CreateTable("CommentRecord", table => table .ContentPartRecord() .Column("Author") .Column("SiteName") .Column("UserName") .Column("Email") .Column("Status") .Column("CommentDateUtc") .Column("CommentText", column => column.Unlimited()) .Column("CommentedOn") .Column("CommentedOnContainer") ); //CREATE TABLE Orchard_Comments_CommentSettingsRecord (Id INTEGER not null, ModerateComments INTEGER, EnableSpamProtection INTEGER, AkismetKey TEXT, AkismetUrl TEXT, primary key (Id)); SchemaBuilder.CreateTable("CommentSettingsRecord", table => table .ContentPartRecord() .Column("ModerateComments") .Column("EnableSpamProtection") .Column("AkismetKey") .Column("AkismetUrl") ); //CREATE TABLE Orchard_Comments_HasCommentsRecord (Id INTEGER not null, CommentsShown INTEGER, CommentsActive INTEGER, primary key (Id)); SchemaBuilder.CreateTable("HasCommentsRecord", table => table .ContentPartRecord() .Column("CommentsShown") .Column("CommentsActive") ); return 0010; } } }