analytics/priv/repo/migrations/20200114131538_add_tweets.exs
2020-01-16 13:39:47 +02:00

21 lines
536 B
Elixir

defmodule Plausible.Repo.Migrations.AddTweets do
use Ecto.Migration
def change do
create table(:tweets) do
add :tweet_id, :text, null: false
add :text, :text, null: false
add :author_handle, :text, null: false
add :author_name, :text, null: false
add :author_image, :text, null: false
add :created, :naive_datetime, null: false
add :link, :string, null: false
timestamps()
end
create index(:tweets, :link)
create unique_index(:tweets, [:link, :tweet_id])
end
end