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)
end

You 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

VersionDescription
1Create cms_directories
2Create cms_pages
3Create cms_page_variants
4Create cms_page_variant_blocks
5Create cms_page_locale_latest_variants
6Create cms_api_tokens
7Add stats (views, path) to cms_pages
8Create cms_media_library
9Enable pgcrypto extension
10Create cms_block_templates
11Add 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

down(opts \\ [])

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)

up(opts \\ [])

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)