No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

28 líneas
1.1KB

  1. <%
  2. ' Migration runner for AxonASP CLI (the WSH runMigrations.vbs cannot run on Linux/AxonASP).
  3. '
  4. ' docker exec -e SERVER_WEB_ROOT=/opt/axonasp/site -e MIGRATE=status axonasp ./axonasp-cli -r /opt/axonasp/site/scripts/migrate.asp
  5. ' MIGRATE = up (default) | down | status
  6. '
  7. Dim cmd : cmd = LCase(CreateObject("WScript.Shell").ExpandEnvironmentStrings("%MIGRATE%"))
  8. If cmd = "%migrate%" Or cmd = "" Then cmd = "up"
  9. %>
  10. <!--#include file="../core/autoload_core.asp" -->
  11. <%
  12. Dim m : Set m = Migrator()
  13. m.MigrationsPath = Server.MapPath("/db/migrations") ' requires SERVER_WEB_ROOT=<framework folder>
  14. m.EnsureSchemaMigrationsTable
  15. Select Case cmd
  16. Case "up" : m.ApplyAllPending
  17. Case "down" : m.RollbackLast
  18. Case "status"
  19. Dim k
  20. Response.Write "Applied:" & vbCrLf
  21. For Each k In m.GetAppliedMigrations().Keys : Response.Write " " & k & vbCrLf : Next
  22. Response.Write "Pending:" & vbCrLf
  23. For Each k In m.GetPendingMigrations().Keys : Response.Write " " & k & vbCrLf : Next
  24. Case Else
  25. Response.Write "Unknown command: " & cmd & " (use up, down, status)" & vbCrLf
  26. End Select
  27. %>

Powered by TurnKey Linux.