Skip to content

Commit 95acf48

Browse files
authored
Merge pull request #278 from WebFiori/refactor-create
refactor: Create Command + Migrations Command
2 parents 9c06b94 + 12a88a9 commit 95acf48

135 files changed

Lines changed: 7192 additions & 9392 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.

App/Database/migrations/multi/Migration000.php renamed to App/Database/Migrations/Multi/Migration000.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ public function __construct() {
1414
parent::__construct('Third One', 2);
1515
}
1616
/**
17-
* Performs the action that will apply the migration.
18-
*
17+
* Performs the action that will revert back the migration.
18+
*
1919
* @param Database $schema The database at which the migration will be applied to.
2020
*/
21-
public function up(Database $schema) : void {
22-
//TODO: Implement the action which will apply the migration to database.
21+
public function down(Database $schema) : void {
22+
//TODO: Implement the action which will revert back the migration.
2323
}
2424
/**
25-
* Performs the action that will revert back the migration.
26-
*
25+
* Performs the action that will apply the migration.
26+
*
2727
* @param Database $schema The database at which the migration will be applied to.
2828
*/
29-
public function down(Database $schema) : void {
30-
//TODO: Implement the action which will revert back the migration.
29+
public function up(Database $schema) : void {
30+
//TODO: Implement the action which will apply the migration to database.
3131
}
3232
}

App/Database/migrations/multi/Migration001.php renamed to App/Database/Migrations/Multi/Migration001.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ public function __construct() {
1414
parent::__construct('Second one', 1);
1515
}
1616
/**
17-
* Performs the action that will apply the migration.
18-
*
17+
* Performs the action that will revert back the migration.
18+
*
1919
* @param Database $schema The database at which the migration will be applied to.
2020
*/
21-
public function up(Database $schema) : void {
22-
//TODO: Implement the action which will apply the migration to database.
21+
public function down(Database $schema) : void {
22+
//TODO: Implement the action which will revert back the migration.
2323
}
2424
/**
25-
* Performs the action that will revert back the migration.
26-
*
25+
* Performs the action that will apply the migration.
26+
*
2727
* @param Database $schema The database at which the migration will be applied to.
2828
*/
29-
public function down(Database $schema) : void{
30-
//TODO: Implement the action which will revert back the migration.
29+
public function up(Database $schema) : void {
30+
//TODO: Implement the action which will apply the migration to database.
3131
}
3232
}

App/Database/migrations/multi/Migration002.php renamed to App/Database/Migrations/Multi/Migration002.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@ public function __construct() {
1414
parent::__construct('First One', 0);
1515
}
1616
/**
17-
* Performs the action that will apply the migration.
18-
*
17+
* Performs the action that will revert back the migration.
18+
*
1919
* @param Database $schema The database at which the migration will be applied to.
2020
*/
21-
public function up(Database $schema) : void {
22-
//TODO: Implement the action which will apply the migration to database.
21+
public function down(Database $schema) : void {
22+
//TODO: Implement the action which will revert back the migration.
2323
}
2424
/**
25-
* Performs the action that will revert back the migration.
26-
*
25+
* Performs the action that will apply the migration.
26+
*
2727
* @param Database $schema The database at which the migration will be applied to.
2828
*/
29-
public function down(Database $schema) : void {
30-
//TODO: Implement the action which will revert back the migration.
29+
public function up(Database $schema) : void {
30+
//TODO: Implement the action which will apply the migration to database.
3131
}
32-
3332
}

App/Database/migrations/multi/MultiRunner.php renamed to App/Database/Migrations/Multi/MultiRunner.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
<?php
22
namespace App\Database\Migrations\Multi;
33

4-
use PHPUnit\TextUI\XmlConfiguration\Migration;
54
use WebFiori\Database\ConnectionInfo;
65
use WebFiori\Database\Schema\SchemaRunner;
7-
use const APP_PATH;
8-
use const DS;
96

107

118
class MultiRunner extends SchemaRunner {
12-
139
public function __construct() {
1410
$conn = new ConnectionInfo('mssql', SQL_SERVER_USER, SQL_SERVER_PASS, SQL_SERVER_DB, SQL_SERVER_HOST, 1433, [
1511
'TrustServerCertificate' => 'true'

App/Database/migrations/multiDownErr/Migration000.php renamed to App/Database/Migrations/MultiDownErr/Migration000.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,17 @@ public function __construct() {
1414
parent::__construct('Third One', 2);
1515
}
1616
/**
17-
* Performs the action that will apply the migration.
18-
*
17+
* Performs the action that will revert back the migration.
18+
*
1919
* @param Database $schema The database at which the migration will be applied to.
2020
*/
21-
public function up(Database $schema) {
22-
21+
public function down(Database $schema) {
2322
}
2423
/**
25-
* Performs the action that will revert back the migration.
26-
*
24+
* Performs the action that will apply the migration.
25+
*
2726
* @param Database $schema The database at which the migration will be applied to.
2827
*/
29-
public function down(Database $schema) {
30-
28+
public function up(Database $schema) {
3129
}
3230
}

App/Database/migrations/multiDownErr/Migration001.php renamed to App/Database/Migrations/MultiDownErr/Migration001.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ public function __construct() {
1414
parent::__construct('Second one', 1);
1515
}
1616
/**
17-
* Performs the action that will apply the migration.
18-
*
17+
* Performs the action that will revert back the migration.
18+
*
1919
* @param Database $schema The database at which the migration will be applied to.
2020
*/
21-
public function up(Database $schema) {
22-
//TODO: Implement the action which will apply the migration to database.
21+
public function down(Database $schema) {
22+
$schema->do();
2323
}
2424
/**
25-
* Performs the action that will revert back the migration.
26-
*
25+
* Performs the action that will apply the migration.
26+
*
2727
* @param Database $schema The database at which the migration will be applied to.
2828
*/
29-
public function down(Database $schema) {
30-
$schema->do();
29+
public function up(Database $schema) {
30+
//TODO: Implement the action which will apply the migration to database.
3131
}
3232
}

0 commit comments

Comments
 (0)