Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

122 рядки
3.9KB

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

Powered by TurnKey Linux.