1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-27 18:31:07 +00:00
mobilizon/priv/repo/migrations/20200221160744_create_resources.exs
Thomas Citharel 4144e9ffd0
Introduce group basic federation, event new page and notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-06-03 16:01:26 +02:00

23 lines
723 B
Elixir

defmodule Mobilizon.Repo.Migrations.CreateResources do
use Ecto.Migration
def change do
create table(:resource, primary_key: false) do
add(:id, :uuid, primary_key: true)
add(:title, :string, null: false)
add(:url, :string, null: false)
add(:type, :integer, null: false)
add(:summary, :text)
add(:resource_url, :string)
add(:metadata, :map)
add(:path, :string, null: false)
add(:parent_id, references(:resource, on_delete: :delete_all, type: :uuid), null: true)
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
add(:creator_id, references(:actors, on_delete: :nilify_all), null: true)
timestamps()
end
end
end