MigrationRepositoryInterface.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Database\Migrations;
  12. interface MigrationRepositoryInterface
  13. {
  14. /**
  15. * Get the completed migrations.
  16. *
  17. * @return array
  18. */
  19. public function getRan();
  20. /**
  21. * Get list of migrations.
  22. *
  23. * @param int $steps
  24. * @return array
  25. */
  26. public function getMigrations($steps);
  27. /**
  28. * Get the last migration batch.
  29. *
  30. * @return array
  31. */
  32. public function getLast();
  33. /**
  34. * Get the completed migrations with their batch numbers.
  35. *
  36. * @return array
  37. */
  38. public function getMigrationBatches();
  39. /**
  40. * Log that a migration was run.
  41. *
  42. * @param string $file
  43. * @param int $batch
  44. */
  45. public function log($file, $batch);
  46. /**
  47. * Remove a migration from the log.
  48. *
  49. * @param object $migration
  50. */
  51. public function delete($migration);
  52. /**
  53. * Get the next migration batch number.
  54. *
  55. * @return int
  56. */
  57. public function getNextBatchNumber();
  58. /**
  59. * Create the migration repository data store.
  60. */
  61. public function createRepository();
  62. /**
  63. * Determine if the migration repository exists.
  64. *
  65. * @return bool
  66. */
  67. public function repositoryExists();
  68. /**
  69. * Set the information source to gather data.
  70. */
  71. public function setSource(?string $name);
  72. }