master

laravel/framework

Last updated at: 29/12/2023 09:22

MigrationRepositoryInterface.php

TLDR

This file defines an interface called MigrationRepositoryInterface which outlines the methods that an implementation of a migration repository class should have.

Methods

getRan

Returns an array of the completed migrations.

getMigrations

Returns an array of the list of migrations, based on the number of steps specified.

getMigrationsByBatch

Returns an array of the list of migrations based on the batch number specified.

getLast

Returns an array of the last migration batch.

getMigrationBatches

Returns an array of the completed migrations with their batch numbers.

log

Logs that a migration was run, with the file name and batch number specified.

delete

Removes a migration from the log, using the migration object specified.

getNextBatchNumber

Returns the next migration batch number.

createRepository

Creates the migration repository data store.

repositoryExists

Determines if the migration repository exists.

deleteRepository

Deletes the migration repository data store.

setSource

Sets the information source to gather data.

<?php

namespace Illuminate\Database\Migrations;

interface MigrationRepositoryInterface
{
    /**
     * Get the completed migrations.
     *
     * @return array
     */
    public function getRan();

    /**
     * Get the list of migrations.
     *
     * @param  int  $steps
     * @return array
     */
    public function getMigrations($steps);

    /**
     * Get the list of the migrations by batch.
     *
     * @param  int  $batch
     * @return array
     */
    public function getMigrationsByBatch($batch);

    /**
     * Get the last migration batch.
     *
     * @return array
     */
    public function getLast();

    /**
     * Get the completed migrations with their batch numbers.
     *
     * @return array
     */
    public function getMigrationBatches();

    /**
     * Log that a migration was run.
     *
     * @param  string  $file
     * @param  int  $batch
     * @return void
     */
    public function log($file, $batch);

    /**
     * Remove a migration from the log.
     *
     * @param  object  $migration
     * @return void
     */
    public function delete($migration);

    /**
     * Get the next migration batch number.
     *
     * @return int
     */
    public function getNextBatchNumber();

    /**
     * Create the migration repository data store.
     *
     * @return void
     */
    public function createRepository();

    /**
     * Determine if the migration repository exists.
     *
     * @return bool
     */
    public function repositoryExists();

    /**
     * Delete the migration repository data store.
     *
     * @return void
     */
    public function deleteRepository();

    /**
     * Set the information source to gather data.
     *
     * @param  string  $name
     * @return void
     */
    public function setSource($name);
}