Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

127 строки
4.3KB

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

Powered by TurnKey Linux.