Add anonymous and remote participations

This commit is contained in:
Thomas Citharel
2019-12-20 13:04:34 +01:00
parent 17e0b3968f
commit 2ed9050a90
135 changed files with 10141 additions and 2271 deletions

View File

@@ -0,0 +1,27 @@
defmodule Mobilizon.Storage.Repo.Migrations.AddMetadataToParticipant do
use Ecto.Migration
def up do
drop_if_exists(unique_index(:participants, [:event_id, :actor_id]))
alter table(:participants) do
add(:metadata, :map)
end
flush()
execute(
"CREATE UNIQUE INDEX participants_metadata_confirmation_token_index ON participants((metadata->>'confirmation_token'))"
)
end
def down do
create_if_not_exists(unique_index(:participants, [:event_id, :actor_id]))
execute("DROP INDEX IF EXISTS participants_metadata_confirmation_token_index")
alter table(:participants) do
remove(:metadata, :map)
end
end
end

View File

@@ -0,0 +1,12 @@
defmodule Mobilizon.Storage.Repo.Migrations.AddNotConfirmedStatusToParticipants do
use Ecto.Migration
@disable_ddl_transaction true
def up do
Ecto.Migration.execute("ALTER TYPE participant_role ADD VALUE IF NOT EXISTS 'not_confirmed'")
end
def down do
IO.puts("Not removing value 'not_confirmed' from participant_role type")
end
end

View File

@@ -0,0 +1,15 @@
defmodule Mobilizon.Repo.Migrations.CreateAdminSettings do
use Ecto.Migration
def change do
create table(:admin_settings) do
add(:group, :string)
add(:name, :string)
add(:value, :text)
timestamps()
end
create(unique_index(:admin_settings, [:group, :name]))
end
end