Refactored data migration to correct SQL Server bugs

- Added explicit Identity column specification
- Defined string lengths explicitly on needed columns

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-07-08 15:18:13 -07:00
parent 199c462d4d
commit 7abd8ac71c
15 changed files with 65 additions and 39 deletions

View File

@@ -6,7 +6,7 @@ namespace Orchard.Blogs.DataMigrations {
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>("Id", column => column.PrimaryKey().Identity())
.Column<int>("Year")
.Column<int>("Month")
.Column<int>("PostCount")
@@ -15,7 +15,7 @@ namespace Orchard.Blogs.DataMigrations {
//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())
.ContentPartRecord()
.Column<string>("Description")
.Column<int>("PostCount")
);