You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 8 месеци
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <%
  2. Option Explicit
  3. Sub put(v)
  4. response.write v & "<br>"
  5. End Sub
  6. Sub put_
  7. put ""
  8. End Sub
  9. Sub put_error(s)
  10. put "<span style='color: red; font-weight: bold;'>" & s & "</span>"
  11. End Sub
  12. %>
  13. <!--#include file="../../MVC/lib.all.asp"-->
  14. <!--#include file="../../App/DAL/lib.DAL.asp"-->
  15. <!--#include file="lib.Migrations.asp"-->
  16. <%
  17. 'Have to initialize Migrations_Class before including any actual migrations, because they each automatically append themselves to the Migrations class for convenience.
  18. 'TODO: This can be refactored by not having the individual migration files auto-add themselves, but then this file must manually add each one using a slightly dIfferent
  19. ' naming convention, i.e. given include file 01_Create_Users.asp the command would be Migrations.Add "Migration_01_Create_Users" or such. At least this way is automated.
  20. Migrations.Initialize "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=" & Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\webdata.mdb;"
  21. Migrations.Tracing = false
  22. %>
  23. <!--#include file="Migration_01_Create_Jurisdiction_Table.asp"-->
  24. <!--#include file="Migration_02_Create_Contact_Table.asp"-->
  25. <!--#include file="Migration_03_Create_Settings_Table.asp"-->
  26. <!--#include file="Migration_04_Create_Kit_Table.asp"-->
  27. <!--#include file="Migration_05_Create_Kit_Labels_Table.asp"-->
  28. <%
  29. Sub HandleMigration
  30. putl "<b>Starting Version: " & Migrations.Version & "</b>"
  31. If Request.Form("mode") = "direct" then
  32. If Request.Form("direction") = "Up" then
  33. If Len(Request.Form("to")) > 0 then
  34. Migrations.MigrateUpTo(Request.Form("to"))
  35. Else
  36. Migrations.MigrateUp
  37. End If
  38. ElseIf Request.Form("direction") = "Down" then
  39. If Len(Request.Form("to")) > 0 then
  40. Migrations.MigrateDownTo(Request.Form("to"))
  41. Else
  42. Migrations.MigrateDown
  43. End If
  44. End If
  45. ElseIf Request.Form("mode") = "up_one" then
  46. Migrations.MigrateUpBy 1
  47. ElseIf Request.Form("mode") = "down_one" then
  48. Migrations.MigrateDownBy 1
  49. End If
  50. putl "<b style='color: darkgreen'>Final Version: " & Migrations.Version & "</b>"
  51. End Sub
  52. Sub ShowForm
  53. %>
  54. <form action="migrate.asp" method="POST">
  55. <input type="hidden" name="mode" value="direct">
  56. <p>
  57. <b>Direction: </b>
  58. <select name="direction">
  59. <option value="Up">Up</option>
  60. <option value="Down">Down</option>
  61. </select>
  62. &nbsp;&nbsp;
  63. <b>To: </b>
  64. <input type="text" size="5" name="to">
  65. &nbsp;&nbsp;
  66. <input type="Submit" value="Migrate!">
  67. </p>
  68. </form>
  69. <form action="migrate.asp" method="POST" style="display: inline">
  70. <input type="hidden" name="mode" value="up_one">
  71. <input type="Submit" value="Up 1">
  72. </form>
  73. <form action="migrate.asp" method="POST">
  74. <input type="hidden" name="mode" value="down_one">
  75. <input type="Submit" value="Down 1">
  76. </form>
  77. <hr>
  78. <%
  79. End Sub
  80. Sub Main
  81. ShowForm
  82. If Len(Request.Form("mode")) > 0 then
  83. HandleMigration
  84. Else
  85. putl "<b>Version: " & Migrations.Version & "</b>"
  86. End If
  87. End Sub
  88. %>
  89. <!doctype html>
  90. <html>
  91. <head>
  92. <style>
  93. body { font-family: calibri; }
  94. </style>
  95. </head>
  96. <body>
  97. <% Main %>
  98. </body>
  99. </html>

Powered by TurnKey Linux.