20 lines
580 B
Elixir
20 lines
580 B
Elixir
defmodule Core.Repo.Migrations.AddMastodonPostsTable do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:mastodon_posts, primary_key: false) do
|
|
add :id, :uuid, primary_key: true
|
|
add :post_id, references(:posts, type: :uuid, on_delete: :delete_all), null: false
|
|
add :status_id, :text, null: false
|
|
add :url, :text, null: false
|
|
|
|
timestamps(type: :utc_datetime_usec)
|
|
end
|
|
|
|
create unique_index(:mastodon_posts, [:post_id])
|
|
|
|
alter table(:posts) do
|
|
add :syndicate_to_mastodon, :boolean, default: false, null: false
|
|
end
|
|
end
|
|
end
|