@@ 70-95 (lines=26) @@ | ||
67 | * @param bool $pretend |
|
68 | * @return void |
|
69 | */ |
|
70 | protected function runUp($file, $batch, $pretend) |
|
71 | { |
|
72 | ||
73 | /** |
|
74 | * Run our migrations first. |
|
75 | * |
|
76 | * @var Migration $migration |
|
77 | */ |
|
78 | $migration = $this->resolve($file); |
|
79 | ||
80 | /** |
|
81 | * Set the addon if there is |
|
82 | * one contextually available. |
|
83 | * |
|
84 | * @var Addon $addon |
|
85 | */ |
|
86 | if ($addon = $this->getAddon()) { |
|
87 | $migration->setAddon($addon); |
|
88 | } |
|
89 | ||
90 | if ($migration instanceof Migration) { |
|
91 | $this->dispatch(new Migrate($migration)); |
|
92 | } |
|
93 | ||
94 | parent::runUp($file, $batch, $pretend); |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * Run "down" a migration instance. |
|
@@ 105-129 (lines=25) @@ | ||
102 | * @param bool $pretend |
|
103 | * @return void |
|
104 | */ |
|
105 | protected function runDown($file, $migration, $pretend) |
|
106 | { |
|
107 | /** |
|
108 | * Run our migrations first. |
|
109 | * |
|
110 | * @var Migration $migration |
|
111 | */ |
|
112 | $migration = $this->resolve($file); |
|
113 | ||
114 | /** |
|
115 | * Set the addon if there is |
|
116 | * one contextually available. |
|
117 | * |
|
118 | * @var Addon $addon |
|
119 | */ |
|
120 | if ($addon = $this->getAddon()) { |
|
121 | $migration->setAddon($addon); |
|
122 | } |
|
123 | ||
124 | if ($migration instanceof Migration) { |
|
125 | $this->dispatch(new Reset($migration)); |
|
126 | } |
|
127 | ||
128 | parent::runDown($file, $migration, $pretend); |
|
129 | } |
|
130 | ||
131 | /** |
|
132 | * Resolve a migration instance from a file. |