-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New footer template, bump schema version, #14
Refactored the header and footer, all courses must be updated and re-imported. Added a course.json schema and schema validation as part of the import process.
- Loading branch information
1 parent
e63bf14
commit c075579
Showing
10 changed files
with
347 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
database/migrations/2018_08_15_221459_refactor_header_footer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace | ||
class RefactorHeaderFooter extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('courses', function (Blueprint $table) { | ||
$table->dropColumn('header'); | ||
$table->dropColumn('headertext'); | ||
$table->dropColumn('footer'); | ||
}); | ||
|
||
Schema::table('courses', function (Blueprint $table) { | ||
$table->json('header')->default('{}'); | ||
$table->json('footer')->default('{}'); | ||
|
||
$table->string('domain')->nullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('courses', function (Blueprint $table) { | ||
$table->dropColumn('domain'); | ||
|
||
$table->dropColumn('header'); | ||
$table->dropColumn('footer'); | ||
}); | ||
|
||
Schema::table('courses', function (Blueprint $table) { | ||
$table->string('header'); | ||
$table->text('headertext'); | ||
$table->string('footer'); | ||
}); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.