31 lines
800 B
Elixir
31 lines
800 B
Elixir
defmodule Mobilizon.Repo.Migrations.CreateCollections do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:collections, primary_key: false) do
|
|
add(:id, :uuid, primary_key: true)
|
|
add(:title, :string)
|
|
add(:url, :string)
|
|
add(:summary, :string)
|
|
add(:public, :boolean, default: false, null: false)
|
|
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
|
|
|
|
timestamps()
|
|
end
|
|
|
|
create table(:resource, primary_key: false) do
|
|
add(:id, :uuid, primary_key: true)
|
|
add(:title, :string)
|
|
add(:url, :string)
|
|
add(:summary, :string)
|
|
add(:resource_url, :string)
|
|
|
|
add(:collection_id, references(:collections, on_delete: :delete_all, type: :uuid),
|
|
null: false
|
|
)
|
|
|
|
timestamps()
|
|
end
|
|
end
|
|
end
|