Normandy.Behaviours.SessionStore.Postgres.Migration (normandy v2.2.0)

View Source

Migration for the Postgres SessionStore. Call from a host migration:

defmodule MyApp.Repo.Migrations.AddNormandySessions do
  use Ecto.Migration
  def up, do: Normandy.Behaviours.SessionStore.Postgres.Migration.up()
  def down, do: Normandy.Behaviours.SessionStore.Postgres.Migration.down()
end

Summary

Functions

Drops normandy_sessions and normandy_session_entries with their rows.

Creates normandy_session_entries (id, parent_id, turn_id, role, content, inserted_at; an index on parent_id) and normandy_sessions (session_id, head_id, current_turn_id, turn_state, timestamps).

Functions

down()

Drops normandy_sessions and normandy_session_entries with their rows.

up()

Creates normandy_session_entries (id, parent_id, turn_id, role, content, inserted_at; an index on parent_id) and normandy_sessions (session_id, head_id, current_turn_id, turn_state, timestamps).

Run it first; the MigrationAdd* modules alter normandy_sessions.