Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

120 lines
3.7KB

  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 - Copy.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. <!--#include file="Migration_06_Alter_Kit_Tabl.asp"-->
  29. <!--#include file="Migration_07_Alter_Kit_Table_Labels_With_Set.asp"-->
  30. <!--#include file="Migration_08_Alter_Kit_Table_With_InkjetJob.asp"-->
  31. <!--#include file="Migration_09_Create_InkJetRecords_Table.asp"-->
  32. <%
  33. Sub HandleMigration
  34. putl "<b>Starting Version: " & Migrations.Version & "</b>"
  35. If Request.Form("mode") = "direct" then
  36. If Request.Form("direction") = "Up" then
  37. If Len(Request.Form("to")) > 0 then
  38. Migrations.MigrateUpTo(Request.Form("to"))
  39. Else
  40. Migrations.MigrateUp
  41. End If
  42. ElseIf Request.Form("direction") = "Down" then
  43. If Len(Request.Form("to")) > 0 then
  44. Migrations.MigrateDownTo(Request.Form("to"))
  45. Else
  46. Migrations.MigrateDown
  47. End If
  48. End If
  49. ElseIf Request.Form("mode") = "up_one" then
  50. Migrations.MigrateUpBy 1
  51. ElseIf Request.Form("mode") = "down_one" then
  52. Migrations.MigrateDownBy 1
  53. End If
  54. putl "<b style='color: darkgreen'>Final Version: " & Migrations.Version & "</b>"
  55. End Sub
  56. Sub ShowForm
  57. %>
  58. <form action="migrate.asp" method="POST">
  59. <input type="hidden" name="mode" value="direct">
  60. <p>
  61. <b>Direction: </b>
  62. <select name="direction">
  63. <option value="Up">Up</option>
  64. <option value="Down">Down</option>
  65. </select>
  66. &nbsp;&nbsp;
  67. <b>To: </b>
  68. <input type="text" size="5" name="to">
  69. &nbsp;&nbsp;
  70. <input type="Submit" value="Migrate!">
  71. </p>
  72. </form>
  73. <form action="migrate.asp" method="POST" style="display: inline">
  74. <input type="hidden" name="mode" value="up_one">
  75. <input type="Submit" value="Up 1">
  76. </form>
  77. <form action="migrate.asp" method="POST">
  78. <input type="hidden" name="mode" value="down_one">
  79. <input type="Submit" value="Down 1">
  80. </form>
  81. <hr>
  82. <%
  83. End Sub
  84. Sub Main
  85. ShowForm
  86. If Len(Request.Form("mode")) > 0 then
  87. HandleMigration
  88. Else
  89. putl "<b>Version: " & Migrations.Version & "</b>"
  90. End If
  91. End Sub
  92. %>
  93. <!doctype html>
  94. <html>
  95. <head>
  96. <style>
  97. body { font-family: calibri; }
  98. </style>
  99. </head>
  100. <body>
  101. <% Main %>
  102. </body>
  103. </html>

Powered by TurnKey Linux.