Add description slug field for events

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-04-11 14:45:31 +02:00
parent 16a9df48a7
commit ddad462076
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
3 changed files with 12 additions and 0 deletions

View file

@ -41,6 +41,7 @@ defmodule Mobilizon.Events.Event do
field(:url, :string)
field(:local, :boolean, default: true)
field(:begins_on, :utc_datetime)
field(:slug, :string)
field(:description, :string)
field(:ends_on, :utc_datetime)
field(:title, :string)
@ -70,6 +71,7 @@ defmodule Mobilizon.Events.Event do
event
|> Ecto.Changeset.cast(attrs, [
:title,
:slug,
:description,
:url,
:begins_on,

View file

@ -17,6 +17,7 @@ defmodule MobilizonWeb.Schema.EventType do
field(:url, :string, description: "The ActivityPub Event URL")
field(:local, :boolean, description: "Whether the event is local or not")
field(:title, :string, description: "The event's title")
field(:slug, :string, description: "The event's description's slug")
field(:description, :string, description: "The event's description")
field(:begins_on, :datetime, description: "Datetime for when the event begins")
field(:ends_on, :datetime, description: "Datetime for when the event ends")

View file

@ -0,0 +1,9 @@
defmodule Elixir.Mobilizon.Repo.Migrations.EventAddDescriptionSlug do
use Ecto.Migration
def change do
alter table(:events) do
add(:slug, :string)
end
end
end