<% '======================================================================================================================= ' MIGRATION: create_posts_table '======================================================================================================================= Sub Migration_Up(migration) migration.CreateTable "Posts", _ "PostID COUNTER CONSTRAINT PK_Posts PRIMARY KEY, " & _ "Title TEXT(200) NOT NULL, " & _ "Slug TEXT(200) NOT NULL, " & _ "Summary MEMO, " & _ "Body MEMO, " & _ "CategoryID LONG, " & _ "IsPublished SMALLINT NOT NULL, " & _ "PublishedDate DATETIME, " & _ "CreatedDate DATETIME NOT NULL, " & _ "UpdatedDate DATETIME" migration.ExecuteSQL "UPDATE Posts SET IsPublished = 0 WHERE IsPublished IS NULL" migration.CreateIndex "IX_Posts_Slug", "Posts", "Slug" migration.CreateIndex "IX_Posts_CategoryID", "Posts", "CategoryID" migration.CreateIndex "IX_Posts_IsPublished", "Posts", "IsPublished" End Sub Sub Migration_Down(migration) migration.DropIndex "IX_Posts_IsPublished", "Posts" migration.DropIndex "IX_Posts_CategoryID", "Posts" migration.DropIndex "IX_Posts_Slug", "Posts" migration.DropTable "Posts" End Sub %>