|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
4
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
5
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
6
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
7
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
8
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
9
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
10
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
11
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
12
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
13
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
14
|
|
|
* |
|
15
|
|
|
* This software consists of voluntary contributions made by many individuals |
|
16
|
|
|
* and is licensed under the MIT license. For more information, see |
|
17
|
|
|
* <https://github.com/baleen/migrations>. |
|
18
|
|
|
*/ |
|
19
|
|
|
|
|
20
|
|
|
namespace Baleen\Migrations\Delta; |
|
21
|
|
|
|
|
22
|
|
|
use Baleen\Migrations\Service\MigrationBus\MigrateCommand; |
|
23
|
|
|
use Baleen\Migrations\Migration\MigrationInterface; |
|
24
|
|
|
use Baleen\Migrations\Migration\OptionsInterface; |
|
25
|
|
|
use Baleen\Migrations\Common\EntityInterface; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Holds meta information about a migration, especially that which is related to its status (i.e. anything that can't |
|
29
|
|
|
* be stored in the migration itself). |
|
30
|
|
|
* |
|
31
|
|
|
* @author Gabriel Somoza <[email protected]> |
|
32
|
|
|
*/ |
|
33
|
|
|
interface DeltaInterface extends EntityInterface |
|
34
|
|
|
{ |
|
35
|
|
|
/** |
|
36
|
|
|
* Returns the ID value object for this version. |
|
37
|
|
|
* |
|
38
|
|
|
* @return DeltaId |
|
39
|
|
|
*/ |
|
40
|
|
|
public function getId(); |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Returns whether the version has been migrated or not. Returns NULL if unknown. |
|
44
|
|
|
* |
|
45
|
|
|
* @return null|bool |
|
46
|
|
|
*/ |
|
47
|
|
|
public function isMigrated(); |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Returns the entity's ID as string |
|
51
|
|
|
* |
|
52
|
|
|
* @return string |
|
53
|
|
|
*/ |
|
54
|
|
|
public function __toString(); |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Executes a MigrateCommand through the migrationBus |
|
58
|
|
|
* |
|
59
|
|
|
* @param OptionsInterface $options |
|
60
|
|
|
* |
|
61
|
|
|
* @return void |
|
62
|
|
|
*/ |
|
63
|
|
|
public function migrate(OptionsInterface $options); |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Returns the FQCN of the Migration. Used for sorting. |
|
67
|
|
|
* |
|
68
|
|
|
* @return string |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getMigrationClassName(); |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* The filename of the file in which the migration class has been defined. If the class is defined in a PHP |
|
74
|
|
|
* extension, FALSE is returned. |
|
75
|
|
|
* |
|
76
|
|
|
* @return string|false |
|
77
|
|
|
*/ |
|
78
|
|
|
public function getMigrationFileName(); |
|
79
|
|
|
} |
|
80
|
|
|
|