AshScylla.Schema behaviour (AshScylla v0.10.0)

Copy Markdown View Source

Behaviour for schema migration modules loaded from priv/migrations.

Schema files are optional Elixir modules that return CQL statements from change/0. They are useful for generated or hand-written schema changes that should run before AshScylla's resource-driven migrations.

Example

defmodule MyApp.Migrations.AddUserTable do
  use AshScylla.Schema

  def change do
    [
      "CREATE TABLE IF NOT EXISTS users (id UUID PRIMARY KEY, name TEXT)"
    ]
  end
end

Summary

Types

cql()

@type cql() :: String.t()

Callbacks

change()

@callback change() :: [cql()]