From 5dbfa133e76ce8ec6c4113dec4aa0a2a998a6735 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Thu, 1 Nov 2018 21:53:16 -0600 Subject: [PATCH] Config file change and cms_themes_contents table migration --- config/cms.php | 26 +++++++++++++++++++ ...018_11_01_000001_Db_Cms_Theme_Contents.php | 25 ++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 modules/cms/database/migrations/2018_11_01_000001_Db_Cms_Theme_Contents.php diff --git a/config/cms.php b/config/cms.php index e0f58e236..c89b3d114 100644 --- a/config/cms.php +++ b/config/cms.php @@ -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, + ]; diff --git a/modules/cms/database/migrations/2018_11_01_000001_Db_Cms_Theme_Contents.php b/modules/cms/database/migrations/2018_11_01_000001_Db_Cms_Theme_Contents.php new file mode 100644 index 000000000..1c46b0177 --- /dev/null +++ b/modules/cms/database/migrations/2018_11_01_000001_Db_Cms_Theme_Contents.php @@ -0,0 +1,25 @@ +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'); + } +}