ScalesCms.Migration
(scales_cms v0.2.1)
Copy Markdown
Migrations for ScalesCMS.
To use ScalesCMS migrations in your app, create a single Ecto migration and call
up/1 and down/1 with the target version:
defmodule MyApp.Repo.Migrations.AddScalesCms do
use Ecto.Migration
def up, do: ScalesCms.Migration.up(version: 11)
def down, do: ScalesCms.Migration.down(version: 1)
endYou can also migrate incrementally when a new version of ScalesCMS is released by
adding a new migration that calls up with the latest version number.
Versions
| Version | Description |
|---|---|
| 1 | Create cms_directories |
| 2 | Create cms_pages |
| 3 | Create cms_page_variants |
| 4 | Create cms_page_variant_blocks |
| 5 | Create cms_page_locale_latest_variants |
| 6 | Create cms_api_tokens |
| 7 | Add stats (views, path) to cms_pages |
| 8 | Create cms_media_library |
| 9 | Enable pgcrypto extension |
| 10 | Create cms_block_templates |
| 11 | Add block template attributes to cms_page_variant_blocks |
Summary
Functions
Rolls back ScalesCMS migrations down to the given version (inclusive).
Runs ScalesCMS migrations up to the given version.
Functions
Rolls back ScalesCMS migrations down to the given version (inclusive).
Options
:version- the version to roll back to (inclusive). Defaults to the initial version (1).
Example
ScalesCms.Migration.down(version: 1)
Runs ScalesCMS migrations up to the given version.
Options
:version- the target version to migrate to. Defaults to the current maximum version (11).
Example
ScalesCms.Migration.up(version: 11)