🔍 Implement basic event visibility
See https://framagit.org/framasoft/mobilizon/wikis/spec/Event#visibility Also brings support for event status (tentative/confirmed/cancelled) Closes #56 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -2,7 +2,7 @@ defmodule Mobilizon.Repo.Migrations.AddAddressType do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
AddressTypeEnum.create_type
|
||||
Mobilizon.Events.AddressTypeEnum.create_type
|
||||
alter table(:events) do
|
||||
add :address_type, :address_type
|
||||
add :online_address, :string
|
||||
@@ -21,7 +21,7 @@ defmodule Mobilizon.Repo.Migrations.AddAddressType do
|
||||
remove :online_address
|
||||
remove :phone
|
||||
end
|
||||
AddressTypeEnum.drop_type
|
||||
Mobilizon.Events.AddressTypeEnum.drop_type
|
||||
drop constraint(:events, "events_physical_address_id_fkey")
|
||||
rename table(:events), :physical_address_id, to: :address_id
|
||||
alter table(:events) do
|
||||
|
||||
27
priv/repo/migrations/20190103150805_fix_event_visibility.exs
Normal file
27
priv/repo/migrations/20190103150805_fix_event_visibility.exs
Normal file
@@ -0,0 +1,27 @@
|
||||
defmodule Mobilizon.Repo.Migrations.FixEventVisibility do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
Mobilizon.Events.EventVisibilityEnum.create_type
|
||||
Mobilizon.Events.EventStatusEnum.create_type
|
||||
alter table(:events) do
|
||||
remove(:public)
|
||||
remove(:status)
|
||||
remove(:state)
|
||||
add(:visibility, Mobilizon.Events.EventVisibilityEnum.type())
|
||||
add(:status, Mobilizon.Events.EventStatusEnum.type())
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
alter table(:events) do
|
||||
remove(:visibility)
|
||||
remove(:status)
|
||||
add(:state, :integer, null: false, default: 0)
|
||||
add(:public, :boolean, null: false, default: false)
|
||||
add(:status, :integer, null: false, default: 0)
|
||||
end
|
||||
Mobilizon.Events.EventVisibilityEnum.drop_type
|
||||
Mobilizon.Events.EventStatusEnum.drop_type
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user