-
-
Notifications
You must be signed in to change notification settings - Fork 236
Expand file tree
/
Copy pathWinterUp.php
More file actions
63 lines (53 loc) · 1.57 KB
/
WinterUp.php
File metadata and controls
63 lines (53 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace System\Console;
use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Contracts\Console\Isolatable;
use System\Classes\UpdateManager;
/**
* Console command to migrate the database.
*
* This builds up all database tables that are registered for Winter and all plugins.
*
* @package winter\wn-system-module
* @author Alexey Bobkov, Samuel Georges
*/
class WinterUp extends Command implements Isolatable
{
use ConfirmableTrait;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'winter:up
{--seed : Included for compatibility with Laravel default signature, no effect at this time}
{--force : Force the operation to run when in production}
';
/**
* The console command description.
*/
protected $description = 'Builds database tables for Winter and all plugins.';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
// Register aliases for backwards compatibility with October
$this->setAliases(['october:up', 'migrate']);
}
/**
* Execute the console command.
*/
public function handle()
{
if (config('database.console.confirm_in_prod', false) && !$this->confirmToProceed()) {
return 1;
}
$this->output->writeln('<info>Migrating application and plugins...</info>');
UpdateManager::instance()
->setNotesOutput($this->output)
->update();
}
}