ASP Classic blog framework - BrainOrdure
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.2KB

  1. <%
  2. '=======================================================================================================================
  3. ' MIGRATION: create_posts_table
  4. '=======================================================================================================================
  5. Sub Migration_Up(migration)
  6. migration.CreateTable "Posts", _
  7. "PostID COUNTER CONSTRAINT PK_Posts PRIMARY KEY, " & _
  8. "Title TEXT(200) NOT NULL, " & _
  9. "Slug TEXT(200) NOT NULL, " & _
  10. "Summary MEMO, " & _
  11. "Body MEMO, " & _
  12. "CategoryID LONG, " & _
  13. "IsPublished SMALLINT NOT NULL, " & _
  14. "PublishedDate DATETIME, " & _
  15. "CreatedDate DATETIME NOT NULL, " & _
  16. "UpdatedDate DATETIME"
  17. migration.ExecuteSQL "UPDATE Posts SET IsPublished = 0 WHERE IsPublished IS NULL"
  18. migration.CreateIndex "IX_Posts_Slug", "Posts", "Slug"
  19. migration.CreateIndex "IX_Posts_CategoryID", "Posts", "CategoryID"
  20. migration.CreateIndex "IX_Posts_IsPublished", "Posts", "IsPublished"
  21. End Sub
  22. Sub Migration_Down(migration)
  23. migration.DropIndex "IX_Posts_IsPublished", "Posts"
  24. migration.DropIndex "IX_Posts_CategoryID", "Posts"
  25. migration.DropIndex "IX_Posts_Slug", "Posts"
  26. migration.DropTable "Posts"
  27. End Sub
  28. %>

Powered by TurnKey Linux.