Config file change and cms_themes_contents table migration

This commit is contained in:
Luke Towers 2018-11-01 21:53:16 -06:00
parent 7c919e01bc
commit 5dbfa133e7
2 changed files with 51 additions and 0 deletions

View File

@ -381,4 +381,30 @@ return [
'restrictBaseDir' => true,
/*
|--------------------------------------------------------------------------
| CMS Database Layer
|--------------------------------------------------------------------------
|
| Enables the database layer for the CMS content files.
|
| Allowed values:
| - false: Database layer is disabled, the FileDatasource is used
| - true: Database layer is enabled, the AutoDatasource is used
| - null: Setting equal to the inverse of app.debug: debug enabled, this disabled
|
| The database layer stores all modified CMS files in the database.
| Files that are not modified continue to be loaded from the filesystem.
| The `theme:sync $themeDir` console command is available to populate the
| database from the filesystem with the `--toFile` flag to sync in the
| other direction (database to filesystem) and the `--path="/path/to/file.md"
| flag to sync only a specific file.
|
| Files available in the database are cached to indicate that they should
| be loaded from the database.
|
*/
'enableDatabaseLayer' => false,
];

View File

@ -0,0 +1,25 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbCmsThemeContents extends Migration
{
public function up()
{
Schema::create('cms_theme_contents', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('source')->index();
$table->string('path')->index();
$table->longText('content');
$table->integer('file_size')->unsigned();
$table->dateTime('updated_at')->nullable();
});
}
public function down()
{
Schema::dropIfExists('cms_theme_contents');
}
}