Ecto.Migration.Timescaledb (ecto_timescaledb v0.7.0)

Provides migration related functions in TimescaleDB extended SQL for Ecto.Query

Link to this section Summary

Link to this section Functions

Link to this macro

create_hypertable(relation, time_column_name)

(macro)

create_hypertable

Examples

use Ecto.Migration
import Ecto.Migration.Timescaledb

def up do
  create table(:user, primary_key: false) do
    add :joined_at, :naive_datetime, null: false
    add :name, :string
  end

  create_hypertable(:user, :joined_at)
end

def down do
  drop(table(:user))
end