Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

120 rindas
3.8KB

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

Powered by TurnKey Linux.