Add description slug field for events
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
16a9df48a7
commit
ddad462076
|
@ -41,6 +41,7 @@ defmodule Mobilizon.Events.Event do
|
||||||
field(:url, :string)
|
field(:url, :string)
|
||||||
field(:local, :boolean, default: true)
|
field(:local, :boolean, default: true)
|
||||||
field(:begins_on, :utc_datetime)
|
field(:begins_on, :utc_datetime)
|
||||||
|
field(:slug, :string)
|
||||||
field(:description, :string)
|
field(:description, :string)
|
||||||
field(:ends_on, :utc_datetime)
|
field(:ends_on, :utc_datetime)
|
||||||
field(:title, :string)
|
field(:title, :string)
|
||||||
|
@ -70,6 +71,7 @@ defmodule Mobilizon.Events.Event do
|
||||||
event
|
event
|
||||||
|> Ecto.Changeset.cast(attrs, [
|
|> Ecto.Changeset.cast(attrs, [
|
||||||
:title,
|
:title,
|
||||||
|
:slug,
|
||||||
:description,
|
:description,
|
||||||
:url,
|
:url,
|
||||||
:begins_on,
|
:begins_on,
|
||||||
|
|
|
@ -17,6 +17,7 @@ defmodule MobilizonWeb.Schema.EventType do
|
||||||
field(:url, :string, description: "The ActivityPub Event URL")
|
field(:url, :string, description: "The ActivityPub Event URL")
|
||||||
field(:local, :boolean, description: "Whether the event is local or not")
|
field(:local, :boolean, description: "Whether the event is local or not")
|
||||||
field(:title, :string, description: "The event's title")
|
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(:description, :string, description: "The event's description")
|
||||||
field(:begins_on, :datetime, description: "Datetime for when the event begins")
|
field(:begins_on, :datetime, description: "Datetime for when the event begins")
|
||||||
field(:ends_on, :datetime, description: "Datetime for when the event ends")
|
field(:ends_on, :datetime, description: "Datetime for when the event ends")
|
||||||
|
|
|
@ -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
|
Loading…
Reference in a new issue