Browse Source

Fix mix format and format migrations too

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

Fix credo warnings

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

Show elixir version

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

Also lint migrations

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

Reset allow failure to false

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
osm-theme
Thomas Citharel 1 year ago
parent
commit
7dd7e8fc36
No known key found for this signature in database GPG Key ID: A061B9DDE0CA0773
52 changed files with 370 additions and 324 deletions
  1. +1
    -1
      .formatter.exs
  2. +2
    -1
      .gitlab-ci.yml
  3. +5
    -2
      lib/mobilizon_web/api/search.ex
  4. +10
    -11
      priv/repo/migrations/20180109165738_create_accounts.exs
  5. +5
    -5
      priv/repo/migrations/20180109170315_create_users.exs
  6. +4
    -5
      priv/repo/migrations/20180110091747_create_categories.exs
  7. +8
    -9
      priv/repo/migrations/20180110092400_create_addresses.exs
  8. +8
    -9
      priv/repo/migrations/20180110092500_create_groups.exs
  9. +18
    -19
      priv/repo/migrations/20180110092600_create_events.exs
  10. +3
    -4
      priv/repo/migrations/20180110093905_create_tags.exs
  11. +2
    -2
      priv/repo/migrations/20180110093906_create_events_tags.exs
  12. +5
    -6
      priv/repo/migrations/20180110094301_create_participants.exs
  13. +5
    -6
      priv/repo/migrations/20180110094502_create_event_requests.exs
  14. +5
    -6
      priv/repo/migrations/20180110095317_create_members.exs
  15. +5
    -6
      priv/repo/migrations/20180110095515_create_group_requests.exs
  16. +4
    -5
      priv/repo/migrations/20180112100000_create_tracks.exs
  17. +13
    -14
      priv/repo/migrations/20180112105354_create_sessions.exs
  18. +4
    -4
      priv/repo/migrations/20180430071244_remove_uri.exs
  19. +2
    -2
      priv/repo/migrations/20180515091106_add_url_field_to_events.exs
  20. +6
    -6
      priv/repo/migrations/20180515100237_create_comments.exs
  21. +4
    -4
      priv/repo/migrations/20180515142835_alter_event_timestamps_to_date_time_with_time_zone.exs
  22. +4
    -4
      priv/repo/migrations/20180515145438_add_local_attribute_to_events_and_comments.exs
  23. +63
    -58
      priv/repo/migrations/20180517100700_move_from_account_to_actor.exs
  24. +5
    -5
      priv/repo/migrations/20180522133844_add_bots_table.exs
  25. +4
    -4
      priv/repo/migrations/20180530125159_add_avatar_and_banner_to_actor.exs
  26. +2
    -2
      priv/repo/migrations/20180530152323_make_actor_public_key_nullable.exs
  27. +2
    -2
      priv/repo/migrations/20180530170808_add_uuid_id_to_events.exs
  28. +2
    -2
      priv/repo/migrations/20180531162301_add_approved_status_to_member.exs
  29. +2
    -2
      priv/repo/migrations/20180607095732_add_uuid_to_comments.exs
  30. +2
    -2
      priv/repo/migrations/20180614094653_make_shared_inbox_url_nullable.exs
  31. +5
    -4
      priv/repo/migrations/20180614104618_fusion_public_private_key_into_keys_column.exs
  32. +4
    -4
      priv/repo/migrations/20180614131328_add_attributed_to_field_to_events_and_comments.exs
  33. +10
    -7
      priv/repo/migrations/20180628091920_add-user-confirm-email-fields.exs
  34. +10
    -5
      priv/repo/migrations/20180628130746_add-user-password-reset-fields.exs
  35. +4
    -4
      priv/repo/migrations/20180628142835_revert_alter_event_timestamps.exs
  36. +14
    -10
      priv/repo/migrations/20180702150922_add_address_type.exs
  37. +1
    -1
      priv/repo/migrations/20180702154630_remove_slug_for_event.exs
  38. +2
    -2
      priv/repo/migrations/20180706082208_alter_events_set_description_as_text.exs
  39. +4
    -4
      priv/repo/migrations/20180709154152_allow_multiple_accounts_for_user.exs
  40. +10
    -2
      priv/repo/migrations/20180802133951_make_follower_table_unique.exs
  41. +10
    -5
      priv/repo/migrations/20180816093446_add_primary_key_to_member.exs
  42. +2
    -2
      priv/repo/migrations/20181021161324_add_default_actor_user_field.exs
  43. +8
    -8
      priv/repo/migrations/20181108165151_fix_comments_references.exs
  44. +20
    -10
      priv/repo/migrations/20181203092128_change_actors_indexes.exs
  45. +9
    -6
      priv/repo/migrations/20190103150805_fix_event_visibility.exs
  46. +3
    -3
      priv/repo/migrations/20190114162055_remove_address_type.exs
  47. +4
    -4
      priv/repo/migrations/20190125143718_group_delete_members_cascade.exs
  48. +19
    -11
      priv/repo/migrations/20190130151607_split_event_visibility_and_join_options.exs
  49. +14
    -12
      priv/repo/migrations/20190207134142_move_participant_role_to_enum.exs
  50. +11
    -10
      priv/repo/migrations/20190208141700_tags_relations.exs
  51. +1
    -1
      priv/repo/migrations/20190214100858_drop_datetimetz.exs
  52. +0
    -1
      priv/repo/seeds.exs

+ 1
- 1
.formatter.exs View File

@ -1,3 +1,3 @@
[
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"]
inputs: ["{mix,.formatter}.exs", "{config,lib,test,priv}/**/*.{ex,exs}"]
]

+ 2
- 1
.gitlab-ci.yml View File

@ -41,8 +41,9 @@ elixir_check:
before_script:
- mix deps.get
script:
- mix format --check-formatted --dry-run
- mix credo list
- mix format --check-formatted --dry-run
- mix hex.outdated
cache:
paths:
- deps


+ 5
- 2
lib/mobilizon_web/api/search.ex View File

@ -1,4 +1,7 @@
defmodule MobilizonWeb.API.Search do
@moduledoc """
API for Search
"""
alias Mobilizon.Service.ActivityPub
alias Mobilizon.Actors
alias Mobilizon.Actors.Actor
@ -80,7 +83,7 @@ defmodule MobilizonWeb.API.Search do
actor
else
{:error, _err} ->
Logger.debug("Unable to find or make actor '#{search}'")
Logger.debug(fn -> "Unable to find or make actor '#{search}'" end)
nil
end
end
@ -92,7 +95,7 @@ defmodule MobilizonWeb.API.Search do
object
else
{:error, _err} ->
Logger.debug("Unable to find or make object from URL '#{search}'")
Logger.debug(fn -> "Unable to find or make object from URL '#{search}'" end)
nil
end
end


+ 10
- 11
priv/repo/migrations/20180109165738_create_accounts.exs View File

@ -3,20 +3,19 @@ defmodule Mobilizon.Repo.Migrations.CreateAccounts do
def change do
create table(:accounts) do
add :username, :string, null: false
add :domain, :string, null: true
add :display_name, :string, null: true
add :description, :text, null: true
add :private_key, :text, null: true
add :public_key, :text, null: false
add :suspended, :boolean, default: false, null: false
add :uri, :string, null: false
add :url, :string, null: false
add(:username, :string, null: false)
add(:domain, :string, null: true)
add(:display_name, :string, null: true)
add(:description, :text, null: true)
add(:private_key, :text, null: true)
add(:public_key, :text, null: false)
add(:suspended, :boolean, default: false, null: false)
add(:uri, :string, null: false)
add(:url, :string, null: false)
timestamps()
end
create unique_index(:accounts, [:username, :domain])
create(unique_index(:accounts, [:username, :domain]))
end
end

+ 5
- 5
priv/repo/migrations/20180109170315_create_users.exs View File

@ -3,14 +3,14 @@ defmodule Mobilizon.Repo.Migrations.CreateUsers do
def change do
create table(:users) do
add :email, :string, null: false
add :role, :integer, default: 0, null: false
add :password_hash, :string, null: false
add :account_id, references(:accounts, on_delete: :delete_all), null: false
add(:email, :string, null: false)
add(:role, :integer, default: 0, null: false)
add(:password_hash, :string, null: false)
add(:account_id, references(:accounts, on_delete: :delete_all), null: false)
timestamps()
end
create unique_index(:users, [:email])
create(unique_index(:users, [:email]))
end
end

+ 4
- 5
priv/repo/migrations/20180110091747_create_categories.exs View File

@ -3,14 +3,13 @@ defmodule Mobilizon.Repo.Migrations.CreateCategories do
def change do
create table(:categories) do
add :title, :string
add :description, :string
add :picture, :string
add(:title, :string)
add(:description, :string)
add(:picture, :string)
timestamps()
end
create unique_index(:categories, [:title])
create(unique_index(:categories, [:title]))
end
end

+ 8
- 9
priv/repo/migrations/20180110092400_create_addresses.exs View File

@ -3,17 +3,16 @@ defmodule Mobilizon.Repo.Migrations.CreateAddresses do
def change do
create table(:addresses) do
add :description, :string
add :floor, :string
add :addressCountry, :string
add :addressLocality, :string
add :addressRegion, :string
add :postalCode, :string
add :streetAddress, :string
add :geom, :geometry
add(:description, :string)
add(:floor, :string)
add(:addressCountry, :string)
add(:addressLocality, :string)
add(:addressRegion, :string)
add(:postalCode, :string)
add(:streetAddress, :string)
add(:geom, :geometry)
timestamps()
end
end
end

+ 8
- 9
priv/repo/migrations/20180110092500_create_groups.exs View File

@ -3,18 +3,17 @@ defmodule Mobilizon.Repo.Migrations.CreateGroups do
def change do
create table(:groups) do
add :title, :string, null: false
add :slug, :string, null: false
add :description, :string
add :suspended, :boolean, default: false, null: false
add :url, :string
add :uri, :string
add :address_id, references(:addresses, on_delete: :delete_all)
add(:title, :string, null: false)
add(:slug, :string, null: false)
add(:description, :string)
add(:suspended, :boolean, default: false, null: false)
add(:url, :string)
add(:uri, :string)
add(:address_id, references(:addresses, on_delete: :delete_all))
timestamps()
end
create unique_index(:groups, [:slug])
create(unique_index(:groups, [:slug]))
end
end

+ 18
- 19
priv/repo/migrations/20180110092600_create_events.exs View File

@ -3,28 +3,27 @@ defmodule Mobilizon.Repo.Migrations.CreateEvents do
def change do
create table(:events) do
add :title, :string, null: false
add :slug, :string, null: false
add :description, :string, null: true
add :begins_on, :datetimetz
add :ends_on, :datetimetz
add :state, :integer, null: false
add :public, :boolean, null: false
add :status, :integer, null: false
add :large_image, :string
add :thumbnail, :string
add :publish_at, :datetimetz
add :organizer_account_id, references(:accounts, on_delete: :nothing)
add :organizer_group_id, references(:groups, on_delete: :nothing)
add :category_id, references(:categories, on_delete: :nothing), null: false
add :address_id, references(:addresses, on_delete: :delete_all)
add(:title, :string, null: false)
add(:slug, :string, null: false)
add(:description, :string, null: true)
add(:begins_on, :datetimetz)
add(:ends_on, :datetimetz)
add(:state, :integer, null: false)
add(:public, :boolean, null: false)
add(:status, :integer, null: false)
add(:large_image, :string)
add(:thumbnail, :string)
add(:publish_at, :datetimetz)
add(:organizer_account_id, references(:accounts, on_delete: :nothing))
add(:organizer_group_id, references(:groups, on_delete: :nothing))
add(:category_id, references(:categories, on_delete: :nothing), null: false)
add(:address_id, references(:addresses, on_delete: :delete_all))
timestamps()
end
create index(:events, [:organizer_account_id])
create index(:events, [:organizer_group_id])
create unique_index(:events, [:slug])
create(index(:events, [:organizer_account_id]))
create(index(:events, [:organizer_group_id]))
create(unique_index(:events, [:slug]))
end
end

+ 3
- 4
priv/repo/migrations/20180110093905_create_tags.exs View File

@ -3,13 +3,12 @@ defmodule Mobilizon.Repo.Migrations.CreateTags do
def change do
create table(:tags) do
add :title, :string
add :slug, :string, null: false
add(:title, :string)
add(:slug, :string, null: false)
timestamps()
end
create unique_index(:tags, [:slug])
create(unique_index(:tags, [:slug]))
end
end

+ 2
- 2
priv/repo/migrations/20180110093906_create_events_tags.exs View File

@ -3,8 +3,8 @@ defmodule Mobilizon.Repo.Migrations.CreateEventsTags do
def change do
create table(:events_tags, primary_key: false) do
add :event_id, references(:events)
add :tag_id, references(:tags)
add(:event_id, references(:events))
add(:tag_id, references(:tags))
end
end
end

+ 5
- 6
priv/repo/migrations/20180110094301_create_participants.exs View File

@ -3,15 +3,14 @@ defmodule Mobilizon.Repo.Migrations.CreateParticipants do
def change do
create table(:participants, primary_key: false) do
add :role, :integer
add :event_id, references(:events, on_delete: :nothing), primary_key: true
add :account_id, references(:accounts, on_delete: :nothing), primary_key: true
add(:role, :integer)
add(:event_id, references(:events, on_delete: :nothing), primary_key: true)
add(:account_id, references(:accounts, on_delete: :nothing), primary_key: true)
timestamps()
end
create index(:participants, [:event_id])
create index(:participants, [:account_id])
create(index(:participants, [:event_id]))
create(index(:participants, [:account_id]))
end
end

+ 5
- 6
priv/repo/migrations/20180110094502_create_event_requests.exs View File

@ -3,15 +3,14 @@ defmodule Mobilizon.Repo.Migrations.CreateEventRequests do
def change do
create table(:event_requests) do
add :state, :integer
add :event_id, references(:events, on_delete: :nothing)
add :account_id, references(:accounts, on_delete: :nothing)
add(:state, :integer)
add(:event_id, references(:events, on_delete: :nothing))
add(:account_id, references(:accounts, on_delete: :nothing))
timestamps()
end
create index(:event_requests, [:event_id])
create index(:event_requests, [:account_id])
create(index(:event_requests, [:event_id]))
create(index(:event_requests, [:account_id]))
end
end

+ 5
- 6
priv/repo/migrations/20180110095317_create_members.exs View File

@ -3,15 +3,14 @@ defmodule Mobilizon.Repo.Migrations.CreateMembers do
def change do
create table(:members, primary_key: false) do
add :role, :integer
add :group_id, references(:groups, on_delete: :nothing)
add :account_id, references(:accounts, on_delete: :nothing)
add(:role, :integer)
add(:group_id, references(:groups, on_delete: :nothing))
add(:account_id, references(:accounts, on_delete: :nothing))
timestamps()
end
create index(:members, [:group_id])
create index(:members, [:account_id])
create(index(:members, [:group_id]))
create(index(:members, [:account_id]))
end
end

+ 5
- 6
priv/repo/migrations/20180110095515_create_group_requests.exs View File

@ -3,15 +3,14 @@ defmodule Mobilizon.Repo.Migrations.CreateGroupRequests do
def change do
create table(:group_requests) do
add :state, :integer
add :group_id, references(:groups, on_delete: :nothing)
add :account_id, references(:accounts, on_delete: :nothing)
add(:state, :integer)
add(:group_id, references(:groups, on_delete: :nothing))
add(:account_id, references(:accounts, on_delete: :nothing))
timestamps()
end
create index(:group_requests, [:group_id])
create index(:group_requests, [:account_id])
create(index(:group_requests, [:group_id]))
create(index(:group_requests, [:account_id]))
end
end

+ 4
- 5
priv/repo/migrations/20180112100000_create_tracks.exs View File

@ -3,14 +3,13 @@ defmodule Mobilizon.Repo.Migrations.CreateTracks do
def change do
create table(:tracks) do
add :name, :string
add :description, :text
add :color, :string
add(:name, :string)
add(:description, :text)
add(:color, :string)
add :event_id, references(:events, on_delete: :delete_all), null: false
add(:event_id, references(:events, on_delete: :delete_all), null: false)
timestamps()
end
end
end

+ 13
- 14
priv/repo/migrations/20180112105354_create_sessions.exs View File

@ -3,22 +3,21 @@ defmodule Mobilizon.Repo.Migrations.CreateSessions do
def change do
create table(:sessions) do
add :title, :string
add :subtitle, :string
add :short_abstract, :text
add :long_abstract, :text
add :language, :string
add :slides_url, :string
add :videos_urls, :string
add :audios_urls, :string
add :begins_on, :datetimetz
add :ends_on, :datetimetz
add :event_id, references(:events, on_delete: :delete_all), null: false
add :track_id, references(:tracks, on_delete: :delete_all)
add :speaker_id, references(:accounts, on_delete: :delete_all)
add(:title, :string)
add(:subtitle, :string)
add(:short_abstract, :text)
add(:long_abstract, :text)
add(:language, :string)
add(:slides_url, :string)
add(:videos_urls, :string)
add(:audios_urls, :string)
add(:begins_on, :datetimetz)
add(:ends_on, :datetimetz)
add(:event_id, references(:events, on_delete: :delete_all), null: false)
add(:track_id, references(:tracks, on_delete: :delete_all))
add(:speaker_id, references(:accounts, on_delete: :delete_all))
timestamps()
end
end
end

+ 4
- 4
priv/repo/migrations/20180430071244_remove_uri.exs View File

@ -3,21 +3,21 @@ defmodule Mobilizon.Repo.Migrations.RemoveUri do
def up do
alter table("accounts") do
remove :uri
remove(:uri)
end
alter table("groups") do
remove :uri
remove(:uri)
end
end
def down do
alter table("accounts") do
add :uri, :string, null: false, default: "https://"
add(:uri, :string, null: false, default: "https://")
end
alter table("groups") do
add :uri, :string, null: false, default: "https://"
add(:uri, :string, null: false, default: "https://")
end
end
end

+ 2
- 2
priv/repo/migrations/20180515091106_add_url_field_to_events.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.AddUrlFieldToEvents do
def up do
alter table("events") do
add :url, :string, null: false, default: "https://"
add(:url, :string, null: false, default: "https://")
end
end
def down do
alter table("events") do
remove :url
remove(:url)
end
end
end

+ 6
- 6
priv/repo/migrations/20180515100237_create_comments.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.CreateComments do
def change do
create table(:comments) do
add :url, :string
add :text, :text
add(:url, :string)
add(:text, :text)
add :account_id, references(:accounts, on_delete: :nothing), null: false
add :event_id, references(:events, on_delete: :nothing)
add :in_reply_to_comment_id, references(:categories, on_delete: :nothing)
add :origin_comment_id, references(:addresses, on_delete: :delete_all)
add(:account_id, references(:accounts, on_delete: :nothing), null: false)
add(:event_id, references(:events, on_delete: :nothing))
add(:in_reply_to_comment_id, references(:categories, on_delete: :nothing))
add(:origin_comment_id, references(:addresses, on_delete: :delete_all))
timestamps()
end


+ 4
- 4
priv/repo/migrations/20180515142835_alter_event_timestamps_to_date_time_with_time_zone.exs View File

@ -3,15 +3,15 @@ defmodule Mobilizon.Repo.Migrations.AlterEventTimestampsToDateTimeWithTimeZone d
def up do
alter table("events") do
modify :inserted_at, :utc_datetime
modify :updated_at, :utc_datetime
modify(:inserted_at, :utc_datetime)
modify(:updated_at, :utc_datetime)
end
end
def down do
alter table("events") do
modify :inserted_at, :timestamptz
modify :updated_at, :timestamptz
modify(:inserted_at, :timestamptz)
modify(:updated_at, :timestamptz)
end
end
end

+ 4
- 4
priv/repo/migrations/20180515145438_add_local_attribute_to_events_and_comments.exs View File

@ -3,21 +3,21 @@ defmodule Mobilizon.Repo.Migrations.AddLocalAttributeToEventsAndComments do
def up do
alter table("events") do
add :local, :boolean, null: false, default: true
add(:local, :boolean, null: false, default: true)
end
alter table("comments") do
add :local, :boolean, null: false, default: true
add(:local, :boolean, null: false, default: true)
end
end
def down do
alter table("events") do
remove :local
remove(:local)
end
alter table("comments") do
remove :local
remove(:local)
end
end
end

+ 63
- 58
priv/repo/migrations/20180517100700_move_from_account_to_actor.exs View File

@ -2,101 +2,106 @@ defmodule Mobilizon.Repo.Migrations.MoveFromAccountToActor do
use Ecto.Migration
def up do
drop table("event_requests")
drop table("group_requests")
drop(table("event_requests"))
drop(table("group_requests"))
alter table("events") do
remove :organizer_group_id
remove(:organizer_group_id)
end
rename table("members"), :account_id, to: :actor_id
rename(table("members"), :account_id, to: :actor_id)
alter table("members") do
remove :group_id
add :parent_id, references(:accounts, on_delete: :nothing)
remove(:group_id)
add(:parent_id, references(:accounts, on_delete: :nothing))
end
drop table("groups")
rename table("accounts"), to: table("actors")
Mobilizon.Actors.ActorTypeEnum.create_type
rename table("actors"), :username, to: :name
rename table("actors"), :description, to: :summary
rename table("actors"), :display_name, to: :preferred_username
drop(table("groups"))
rename(table("accounts"), to: table("actors"))
Mobilizon.Actors.ActorTypeEnum.create_type()
rename(table("actors"), :username, to: :name)
rename(table("actors"), :description, to: :summary)
rename(table("actors"), :display_name, to: :preferred_username)
alter table("actors") do
add :inbox_url, :string
add :outbox_url, :string
add :following_url, :string, null: true
add :followers_url, :string, null: true
add :shared_inbox_url, :string, null: false, default: ""
add :type, :actor_type
add :manually_approves_followers, :boolean, default: false
modify :name, :string, null: true
modify :preferred_username, :string, null: false
add(:inbox_url, :string)
add(:outbox_url, :string)
add(:following_url, :string, null: true)
add(:followers_url, :string, null: true)
add(:shared_inbox_url, :string, null: false, default: "")
add(:type, :actor_type)
add(:manually_approves_followers, :boolean, default: false)
modify(:name, :string, null: true)
modify(:preferred_username, :string, null: false)
end
create unique_index(:actors, [:preferred_username, :domain])
create(unique_index(:actors, [:preferred_username, :domain]))
rename table("events"), :organizer_account_id, to: :organizer_actor_id
rename(table("events"), :organizer_account_id, to: :organizer_actor_id)
rename table("participants"), :account_id, to: :actor_id
rename(table("participants"), :account_id, to: :actor_id)
create table("followers") do
add :approved, :boolean, default: false
add :score, :integer, default: 1000
add :actor_id, references(:actors, on_delete: :nothing)
add :target_actor_id, references(:actors, on_delete: :nothing)
add(:approved, :boolean, default: false)
add(:score, :integer, default: 1000)
add(:actor_id, references(:actors, on_delete: :nothing))
add(:target_actor_id, references(:actors, on_delete: :nothing))
end
rename table("comments"), :account_id, to: :actor_id
rename(table("comments"), :account_id, to: :actor_id)
rename table("users"), :account_id, to: :actor_id
rename(table("users"), :account_id, to: :actor_id)
end
def down do
create table("event_requests")
create table("group_requests")
create(table("event_requests"))
create(table("group_requests"))
alter table("events") do
add :organizer_group_id, :integer
add(:organizer_group_id, :integer)
end
rename table("members"), :actor_id, to: :account_id
rename(table("members"), :actor_id, to: :account_id)
alter table("members") do
add :group_id, :integer
remove :parent_id
add(:group_id, :integer)
remove(:parent_id)
end
create table("groups")
rename table("actors"), to: table("accounts")
rename table("accounts"), :name, to: :username
rename table("accounts"), :summary, to: :description
rename table("accounts"), :preferred_username, to: :display_name
create(table("groups"))
rename(table("actors"), to: table("accounts"))
rename(table("accounts"), :name, to: :username)
rename(table("accounts"), :summary, to: :description)
rename(table("accounts"), :preferred_username, to: :display_name)
alter table("accounts") do
remove :inbox_url
remove :outbox_url
remove :following_url
remove :followers_url
remove :shared_inbox_url
remove :type
remove :manually_approves_followers
modify :username, :string, null: false
modify :display_name, :string, null: true
remove(:inbox_url)
remove(:outbox_url)
remove(:following_url)
remove(:followers_url)
remove(:shared_inbox_url)
remove(:type)
remove(:manually_approves_followers)
modify(:username, :string, null: false)
modify(:display_name, :string, null: true)
end
Mobilizon.Actors.ActorTypeEnum.drop_type()
rename table("events"), :organizer_actor_id, to: :organizer_account_id
rename(table("events"), :organizer_actor_id, to: :organizer_account_id)
rename table("participants"), :actor_id, to: :account_id
rename(table("participants"), :actor_id, to: :account_id)
rename table("comments"), :actor_id, to: :account_id
rename(table("comments"), :actor_id, to: :account_id)
rename table("users"), :actor_id, to: :account_id
rename(table("users"), :actor_id, to: :account_id)
drop index("accounts", [:preferred_username, :domain], name: :actors_preferred_username_domain_index)
drop(
index("accounts", [:preferred_username, :domain],
name: :actors_preferred_username_domain_index
)
)
drop table("followers")
drop(table("followers"))
end
end

+ 5
- 5
priv/repo/migrations/20180522133844_add_bots_table.exs View File

@ -3,16 +3,16 @@ defmodule Mobilizon.Repo.Migrations.AddBotsTable do
def up do
create table(:bots) do
add :source, :string, null: false
add :type, :string, default: "ics"
add :actor_id, references(:actors, on_delete: :delete_all), null: false
add :user_id, references(:users, on_delete: :delete_all), null: false
add(:source, :string, null: false)
add(:type, :string, default: "ics")
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
add(:user_id, references(:users, on_delete: :delete_all), null: false)
timestamps()
end
end
def down do
drop table(:bots)
drop(table(:bots))
end
end

+ 4
- 4
priv/repo/migrations/20180530125159_add_avatar_and_banner_to_actor.exs View File

@ -3,15 +3,15 @@ defmodule Mobilizon.Repo.Migrations.AddAvatarAndBannerToActor do
def up do
alter table(:actors) do
add :avatar_url, :string
add :banner_url, :string
add(:avatar_url, :string)
add(:banner_url, :string)
end
end
def down do
alter table(:actors) do
remove :avatar_url
remove :banner_url
remove(:avatar_url)
remove(:banner_url)
end
end
end

+ 2
- 2
priv/repo/migrations/20180530152323_make_actor_public_key_nullable.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.MakeActorPublicKeyNullable do
def up do
alter table(:actors) do
modify :public_key, :text, null: true
modify(:public_key, :text, null: true)
end
end
def down do
alter table(:actors) do
modify :public_key, :text, null: false
modify(:public_key, :text, null: false)
end
end
end

+ 2
- 2
priv/repo/migrations/20180530170808_add_uuid_id_to_events.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.AddUUIDIdToEvents do
def up do
alter table(:events) do
add :uuid, :uuid
add(:uuid, :uuid)
end
end
def down do
alter table(:events) do
remove :uuid
remove(:uuid)
end
end
end

+ 2
- 2
priv/repo/migrations/20180531162301_add_approved_status_to_member.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.AddApprovedStatusToMember do
def up do
alter table(:members) do
add :approved, :boolean, default: true
add(:approved, :boolean, default: true)
end
end
def down do
alter table(:members) do
remove :approved
remove(:approved)
end
end
end

+ 2
- 2
priv/repo/migrations/20180607095732_add_uuid_to_comments.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.AddUUIDToComments do
def up do
alter table(:comments) do
add :uuid, :uuid
add(:uuid, :uuid)
end
end
def down do
alter table(:comments) do
remove :uuid
remove(:uuid)
end
end
end

+ 2
- 2
priv/repo/migrations/20180614094653_make_shared_inbox_url_nullable.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.MakeSharedInboxUrlNullable do
def up do
alter table(:actors) do
modify :shared_inbox_url, :string, null: true, default: nil
modify(:shared_inbox_url, :string, null: true, default: nil)
end
end
def down do
alter table(:actors) do
add :shared_inbox_url, :string, null: false, default: ""
add(:shared_inbox_url, :string, null: false, default: "")
end
end
end

+ 5
- 4
priv/repo/migrations/20180614104618_fusion_public_private_key_into_keys_column.exs View File

@ -2,16 +2,17 @@ defmodule Mobilizon.Repo.Migrations.FusionPublicPrivateKeyIntoKeysColumn do
use Ecto.Migration
def up do
rename table(:actors), :private_key, to: :keys
rename(table(:actors), :private_key, to: :keys)
alter table(:actors) do
remove :public_key
remove(:public_key)
end
end
def down do
alter table(:actors) do
rename :keys, to: :private_key
add :public_key, :text, null: true
rename(:keys, to: :private_key)
add(:public_key, :text, null: true)
end
end
end

+ 4
- 4
priv/repo/migrations/20180614131328_add_attributed_to_field_to_events_and_comments.exs View File

@ -3,21 +3,21 @@ defmodule Mobilizon.Repo.Migrations.AddAttributedToFieldToEventsAndComments do
def up do
alter table(:events) do
add :attributed_to_id, references(:actors, on_delete: :nothing)
add(:attributed_to_id, references(:actors, on_delete: :nothing))
end
alter table(:comments) do
add :attributed_to_id, references(:actors, on_delete: :nothing)
add(:attributed_to_id, references(:actors, on_delete: :nothing))
end
end
def down do
alter table(:events) do
remove :attributed_to_id
remove(:attributed_to_id)
end
alter table(:comments) do
remove :attributed_to_id
remove(:attributed_to_id)
end
end
end

+ 10
- 7
priv/repo/migrations/20180628091920_add-user-confirm-email-fields.exs View File

@ -3,18 +3,21 @@ defmodule :"Elixir.Mobilizon.Repo.Migrations.Add-user-confirm-email-fields" do
def up do
alter table(:users) do
add :confirmed_at, :utc_datetime
add :confirmation_sent_at, :utc_datetime
add :confirmation_token, :string
add(:confirmed_at, :utc_datetime)
add(:confirmation_sent_at, :utc_datetime)
add(:confirmation_token, :string)
end
create unique_index(:users, [:confirmation_token], name: "index_unique_users_confirmation_token")
create(
unique_index(:users, [:confirmation_token], name: "index_unique_users_confirmation_token")
)
end
def down do
alter table(:users) do
remove :confirmed_at
remove :confirmation_sent_at
remove :confirmation_token
remove(:confirmed_at)
remove(:confirmation_sent_at)
remove(:confirmation_token)
end
end
end

+ 10
- 5
priv/repo/migrations/20180628130746_add-user-password-reset-fields.exs View File

@ -3,16 +3,21 @@ defmodule :"Elixir.Mobilizon.Repo.Migrations.Add-user-password-reset-fields" do
def up do
alter table(:users) do
add :reset_password_sent_at, :utc_datetime
add :reset_password_token, :string
add(:reset_password_sent_at, :utc_datetime)
add(:reset_password_token, :string)
end
create unique_index(:users, [:reset_password_token], name: "index_unique_users_reset_password_token")
create(
unique_index(:users, [:reset_password_token],
name: "index_unique_users_reset_password_token"
)
)
end
def down do
alter table(:users) do
remove :reset_password_sent_at
remove :reset_password_token
remove(:reset_password_sent_at)
remove(:reset_password_token)
end
end
end

+ 4
- 4
priv/repo/migrations/20180628142835_revert_alter_event_timestamps.exs View File

@ -3,15 +3,15 @@ defmodule Mobilizon.Repo.Migrations.RevertAlterEventTimestampsToDateTimeWithTime
def up do
alter table(:events) do
modify :inserted_at, :timestamptz
modify :updated_at, :timestamptz
modify(:inserted_at, :timestamptz)
modify(:updated_at, :timestamptz)
end
end
def down do
alter table(:events) do
modify :inserted_at, :utc_datetime
modify :updated_at, :utc_datetime
modify(:inserted_at, :utc_datetime)
modify(:updated_at, :utc_datetime)
end
end
end

+ 14
- 10
priv/repo/migrations/20180702150922_add_address_type.exs View File

@ -3,25 +3,29 @@ defmodule Mobilizon.Repo.Migrations.AddAddressType do
def up do
alter table(:events) do
add :online_address, :string
add :phone, :string
add(:online_address, :string)
add(:phone, :string)
end
drop constraint(:events, "events_address_id_fkey")
rename table(:events), :address_id, to: :physical_address_id
drop(constraint(:events, "events_address_id_fkey"))
rename(table(:events), :address_id, to: :physical_address_id)
alter table(:events) do
modify :physical_address_id, references(:addresses, on_delete: :nothing)
modify(:physical_address_id, references(:addresses, on_delete: :nothing))
end
end
def down do
alter table(:events) do
remove :online_address
remove :phone
remove(:online_address)
remove(:phone)
end
drop constraint(:events, "events_physical_address_id_fkey")
rename table(:events), :physical_address_id, to: :address_id
drop(constraint(:events, "events_physical_address_id_fkey"))
rename(table(:events), :physical_address_id, to: :address_id)
alter table(:events) do
modify :address_id, references(:addresses, on_delete: :nothing)
modify(:address_id, references(:addresses, on_delete: :nothing))
end
end
end

+ 1
- 1
priv/repo/migrations/20180702154630_remove_slug_for_event.exs View File

@ -9,7 +9,7 @@ defmodule Mobilizon.Repo.Migrations.RemoveSlugForEvent do
def down do
alter table(:events) do
add :slug, :string, null: false
add(:slug, :string, null: false)
end
end
end

+ 2
- 2
priv/repo/migrations/20180706082208_alter_events_set_description_as_text.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.AlterEventsSetDescriptionAsText do
def up do
alter table(:events) do
modify :description, :text
modify(:description, :text)
end
end
def down do
alter table(:events) do
modify :description, :string
modify(:description, :string)
end
end
end

+ 4
- 4
priv/repo/migrations/20180709154152_allow_multiple_accounts_for_user.exs View File

@ -3,21 +3,21 @@ defmodule Mobilizon.Repo.Migrations.AllowMultipleAccountsForUser do
def up do
alter table(:actors) do
add :user_id, references(:users, on_delete: :delete_all), null: true
add(:user_id, references(:users, on_delete: :delete_all), null: true)
end
alter table(:users) do
remove :actor_id
remove(:actor_id)
end
end
def down do
alter table(:users) do
add :actor_id, references(:actors, on_delete: :delete_all), null: false
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
end
alter table(:actors) do
remove :user_id
remove(:user_id)
end
end
end

+ 10
- 2
priv/repo/migrations/20180802133951_make_follower_table_unique.exs View File

@ -2,10 +2,18 @@ defmodule Mobilizon.Repo.Migrations.MakeFollowerTableUnique do
use Ecto.Migration
def up do
create unique_index(:followers, [:actor_id, :target_actor_id], name: :followers_actor_target_actor_unique_index)
create(
unique_index(:followers, [:actor_id, :target_actor_id],
name: :followers_actor_target_actor_unique_index
)
)
end
def down do
drop index(:followers, [:actor_id, :target_actor_id], name: :followers_actor_target_actor_unique_index)
drop(
index(:followers, [:actor_id, :target_actor_id],
name: :followers_actor_target_actor_unique_index
)
)
end
end

+ 10
- 5
priv/repo/migrations/20180816093446_add_primary_key_to_member.exs View File

@ -3,17 +3,22 @@ defmodule Mobilizon.Repo.Migrations.AddPrimaryKeyToMember do
def up do
execute("ALTER TABLE members DROP CONSTRAINT IF EXISTS members_pkey")
drop_if_exists index(:members, ["members_account_id_index"])
create unique_index(:members, [:actor_id, :parent_id], name: :members_actor_parent_unique_index)
drop_if_exists(index(:members, ["members_account_id_index"]))
create(
unique_index(:members, [:actor_id, :parent_id], name: :members_actor_parent_unique_index)
)
alter table(:members) do
add :id, :serial, primary_key: true
add(:id, :serial, primary_key: true)
end
end
def down do
drop index(:members, [:actor_id, :parent_id], name: :members_actor_parent_unique_index)
drop(index(:members, [:actor_id, :parent_id], name: :members_actor_parent_unique_index))
alter table(:members) do
remove :id
remove(:id)
end
end
end

+ 2
- 2
priv/repo/migrations/20181021161324_add_default_actor_user_field.exs View File

@ -3,13 +3,13 @@ defmodule Mobilizon.Repo.Migrations.AddDefaultActorUserField do
def up do
alter table(:users) do
add :default_actor_id, :integer
add(:default_actor_id, :integer)
end
end
def down do
alter table(:users) do
remove :default_actor_id
remove(:default_actor_id)
end
end
end

+ 8
- 8
priv/repo/migrations/20181108165151_fix_comments_references.exs View File

@ -5,22 +5,22 @@ defmodule Mobilizon.Repo.Migrations.FixCommentsReferences do
use Ecto.Migration
def up do
drop constraint(:comments, "comments_in_reply_to_comment_id_fkey")
drop constraint(:comments, "comments_origin_comment_id_fkey")
drop(constraint(:comments, "comments_in_reply_to_comment_id_fkey"))
drop(constraint(:comments, "comments_origin_comment_id_fkey"))
alter table(:comments) do
modify :in_reply_to_comment_id, references(:comments, on_delete: :nothing)
modify :origin_comment_id, references(:comments, on_delete: :nothing)
modify(:in_reply_to_comment_id, references(:comments, on_delete: :nothing))
modify(:origin_comment_id, references(:comments, on_delete: :nothing))
end
end
def down do
drop constraint(:comments, "comments_in_reply_to_comment_id_fkey")
drop constraint(:comments, "comments_origin_comment_id_fkey")
drop(constraint(:comments, "comments_in_reply_to_comment_id_fkey"))
drop(constraint(:comments, "comments_origin_comment_id_fkey"))
alter table(:comments) do
modify :in_reply_to_comment_id, references(:categories, on_delete: :nothing)
modify :origin_comment_id, references(:addresses, on_delete: :delete_all)
modify(:in_reply_to_comment_id, references(:categories, on_delete: :nothing))
modify(:origin_comment_id, references(:addresses, on_delete: :delete_all))
end
end
end

+ 20
- 10
priv/repo/migrations/20181203092128_change_actors_indexes.exs View File

@ -2,18 +2,28 @@ defmodule Mobilizon.Repo.Migrations.ChangeActorsIndexes do
use Ecto.Migration
def up do
drop index("actors", [:preferred_username, :domain], name: :actors_preferred_username_domain_index)
drop index("actors", [:name, :domain], name: :accounts_username_domain_index)
execute "ALTER INDEX accounts_pkey RENAME TO actors_pkey"
create index("actors", [:preferred_username, :domain, :type], unique: true)
create index("actors", [:url], unique: true)
drop(
index("actors", [:preferred_username, :domain],
name: :actors_preferred_username_domain_index
)
)
drop(index("actors", [:name, :domain], name: :accounts_username_domain_index))
execute("ALTER INDEX accounts_pkey RENAME TO actors_pkey")
create(index("actors", [:preferred_username, :domain, :type], unique: true))
create(index("actors", [:url], unique: true))
end
def down do
create index("actors", [:preferred_username, :domain], name: :actors_preferred_username_domain_index)
create index("actors", [:name, :domain], name: :accounts_username_domain_index)
execute "ALTER INDEX actors_pkey RENAME TO accounts_pkey"
drop index("actors", [:preferred_username, :domain, :type])
drop index("actors", [:url])
create(
index("actors", [:preferred_username, :domain],
name: :actors_preferred_username_domain_index
)
)
create(index("actors", [:name, :domain], name: :accounts_username_domain_index))
execute("ALTER INDEX actors_pkey RENAME TO accounts_pkey")
drop(index("actors", [:preferred_username, :domain, :type]))
drop(index("actors", [:url]))
end
end

+ 9
- 6
priv/repo/migrations/20190103150805_fix_event_visibility.exs View File

@ -2,9 +2,10 @@ defmodule Mobilizon.Repo.Migrations.FixEventVisibility do
use Ecto.Migration
def up do
Mobilizon.Events.EventVisibilityEnum.create_type
Mobilizon.Events.EventStatusEnum.create_type
Mobilizon.Events.CommentVisibilityEnum.create_type
Mobilizon.Events.EventVisibilityEnum.create_type()
Mobilizon.Events.EventStatusEnum.create_type()
Mobilizon.Events.CommentVisibilityEnum.create_type()
alter table(:events) do
remove(:public)
remove(:status)
@ -26,11 +27,13 @@ defmodule Mobilizon.Repo.Migrations.FixEventVisibility do
add(:public, :boolean, null: false, default: false)
add(:status, :integer, null: false, default: 0)
end
alter table(:comments) do
remove(:visibility)
end
Mobilizon.Events.EventVisibilityEnum.drop_type
Mobilizon.Events.EventStatusEnum.drop_type
Mobilizon.Events.CommentVisibilityEnum.drop_type
Mobilizon.Events.EventVisibilityEnum.drop_type()
Mobilizon.Events.EventStatusEnum.drop_type()
Mobilizon.Events.CommentVisibilityEnum.drop_type()
end
end

+ 3
- 3
priv/repo/migrations/20190114162055_remove_address_type.exs View File

@ -3,8 +3,8 @@ defmodule Mobilizon.Repo.Migrations.RemoveAddressType do
require Logger
def up do
execute "ALTER TABLE \"events\" DROP COLUMN IF EXISTS address_type"
execute "DROP TYPE IF EXISTS address_type"
rename table(:events), :phone, to: :phone_address
execute("ALTER TABLE \"events\" DROP COLUMN IF EXISTS address_type")
execute("DROP TYPE IF EXISTS address_type")
rename(table(:events), :phone, to: :phone_address)
end
end

+ 4
- 4
priv/repo/migrations/20190125143718_group_delete_members_cascade.exs View File

@ -2,12 +2,12 @@ defmodule Mobilizon.Repo.Migrations.GroupDeleteMembersCascade do
use Ecto.Migration
def change do
drop constraint(:members, "members_account_id_fkey")
drop constraint(:members, "members_parent_id_fkey")
drop(constraint(:members, "members_account_id_fkey"))
drop(constraint(:members, "members_parent_id_fkey"))
alter table(:members) do
modify :actor_id, references(:actors, on_delete: :delete_all)
modify :parent_id, references(:actors, on_delete: :delete_all)
modify(:actor_id, references(:actors, on_delete: :delete_all))
modify(:parent_id, references(:actors, on_delete: :delete_all))
end
end
end

+ 19
- 11
priv/repo/migrations/20190130151607_split_event_visibility_and_join_options.exs View File

@ -9,17 +9,21 @@ defmodule Mobilizon.Repo.Migrations.SplitEventVisibilityAndJoinOptions do
Visibility allowed nullable values previously
"""
def up do
execute "ALTER TABLE events ALTER COLUMN visibility TYPE VARCHAR USING visibility::text"
EventVisibilityEnum.drop_type
EventVisibilityEnum.create_type
execute "ALTER TABLE events ALTER COLUMN visibility TYPE event_visibility_type USING visibility::event_visibility_type"
execute("ALTER TABLE events ALTER COLUMN visibility TYPE VARCHAR USING visibility::text")
EventVisibilityEnum.drop_type()
EventVisibilityEnum.create_type()
execute(
"ALTER TABLE events ALTER COLUMN visibility TYPE event_visibility_type USING visibility::event_visibility_type"
)
JoinOptionsEnum.create_type()
JoinOptionsEnum.create_type
alter table(:events) do
add(:join_options, JoinOptionsEnum.type(), null: false, default: "free")
end
execute "UPDATE events SET visibility = 'public' WHERE visibility IS NULL"
execute("UPDATE events SET visibility = 'public' WHERE visibility IS NULL")
alter table(:events) do
modify(:visibility, EventVisibilityEnum.type(), null: false, default: "public")
@ -30,11 +34,15 @@ defmodule Mobilizon.Repo.Migrations.SplitEventVisibilityAndJoinOptions do
alter table(:events) do
remove(:join_options)
end
JoinOptionsEnum.drop_type
execute "ALTER TABLE events ALTER COLUMN visibility TYPE VARCHAR USING visibility::text"
EventVisibilityEnum.drop_type
EventVisibilityEnum.create_type
execute "ALTER TABLE events ALTER COLUMN visibility TYPE event_visibility_type USING visibility::event_visibility_type"
JoinOptionsEnum.drop_type()
execute("ALTER TABLE events ALTER COLUMN visibility TYPE VARCHAR USING visibility::text")
EventVisibilityEnum.drop_type()
EventVisibilityEnum.create_type()
execute(
"ALTER TABLE events ALTER COLUMN visibility TYPE event_visibility_type USING visibility::event_visibility_type"
)
end
end

+ 14
- 12
priv/repo/migrations/20190207134142_move_participant_role_to_enum.exs View File

@ -9,16 +9,17 @@ defmodule Mobilizon.Repo.Migrations.MoveParticipantRoleToEnum do
add(:role_tmp, ParticipantRoleEnum.type(), default: "participant")
end
execute "UPDATE participants set role_tmp = 'not_approved' where role = 0"
execute "UPDATE participants set role_tmp = 'participant' where role = 1"
execute "UPDATE participants set role_tmp = 'moderator' where role = 2"
execute "UPDATE participants set role_tmp = 'administrator' where role = 3"
execute "UPDATE participants set role_tmp = 'creator' where role = 4"
execute("UPDATE participants set role_tmp = 'not_approved' where role = 0")
execute("UPDATE participants set role_tmp = 'participant' where role = 1")
execute("UPDATE participants set role_tmp = 'moderator' where role = 2")
execute("UPDATE participants set role_tmp = 'administrator' where role = 3")
execute("UPDATE participants set role_tmp = 'creator' where role = 4")
alter table(:participants) do
remove(:role)
end
rename table(:participants), :role_tmp, to: :role
rename(table(:participants), :role_tmp, to: :role)
end
def down do
@ -26,17 +27,18 @@ defmodule Mobilizon.Repo.Migrations.MoveParticipantRoleToEnum do
add(:role_tmp, :integer, default: 1)
end
execute "UPDATE participants set role_tmp = 0 where role = 'not_approved'"
execute "UPDATE participants set role_tmp = 1 where role = 'participant'"
execute "UPDATE participants set role_tmp = 2 where role = 'moderator'"
execute "UPDATE participants set role_tmp = 3 where role = 'administrator'"
execute "UPDATE participants set role_tmp = 4 where role = 'creator'"
execute("UPDATE participants set role_tmp = 0 where role = 'not_approved'")
execute("UPDATE participants set role_tmp = 1 where role = 'participant'")
execute("UPDATE participants set role_tmp = 2 where role = 'moderator'")
execute("UPDATE participants set role_tmp = 3 where role = 'administrator'")
execute("UPDATE participants set role_tmp = 4 where role = 'creator'")
alter table(:participants) do
remove(:role)
end
ParticipantRoleEnum.drop_type()
rename table(:participants), :role_tmp, to: :role
rename(table(:participants), :role_tmp, to: :role)
end
end

+ 11
- 10
priv/repo/migrations/20190208141700_tags_relations.exs View File

@ -3,20 +3,21 @@ defmodule Mobilizon.Repo.Migrations.TagsRelations do
def up do
create table(:tag_relations, primary_key: false) do
add :tag_id, references(:tags, on_delete: :delete_all), null: false, primary_key: true
add :link_id, references(:tags, on_delete: :delete_all), null: false, primary_key: true
add :weight, :integer, null: false, default: 1
add(:tag_id, references(:tags, on_delete: :delete_all), null: false, primary_key: true)
add(:link_id, references(:tags, on_delete: :delete_all), null: false, primary_key: true)
add(:weight, :integer, null: false, default: 1)
end
create constraint(:tag_relations, :no_self_loops_check, check: "tag_id <> link_id")
create index(:tag_relations, [:tag_id], name: :index_tag_relations_tag_id)
create index(:tag_relations, [:link_id], name: :index_tag_relations_link_id)
create(constraint(:tag_relations, :no_self_loops_check, check: "tag_id <> link_id"))
create(index(:tag_relations, [:tag_id], name: :index_tag_relations_tag_id))
create(index(:tag_relations, [:link_id], name: :index_tag_relations_link_id))
end
def down do
drop constraint(:tag_relations, :no_self_loops_check)
drop(constraint(:tag_relations, :no_self_loops_check))
drop index(:tag_relations, [:tags_id])
drop index(:tag_relations, [:link_id])
drop table(:tag_relations)
drop(index(:tag_relations, [:tags_id]))
drop(index(:tag_relations, [:link_id]))
drop(table(:tag_relations))
end
end

+ 1
- 1
priv/repo/migrations/20190214100858_drop_datetimetz.exs View File

@ -18,7 +18,7 @@ defmodule Mobilizon.Repo.Migrations.DropDatetimetz do
add(:ends_on, :utc_datetime)
end
execute "DROP TYPE datetimetz"
execute("DROP TYPE datetimetz")
end
def down do


+ 0
- 1
priv/repo/seeds.exs View File

@ -39,4 +39,3 @@ insert(:participant, actor: actor, event: event4, role: :participant)
# Insert a group
group = insert(:actor, type: :Group)

Loading…
Cancel
Save