uncomment migrations

This commit is contained in:
byte[] 2020-06-17 07:51:54 -04:00
parent 3ac321079e
commit aaef4b8628
2 changed files with 75 additions and 75 deletions

View file

@ -2,33 +2,33 @@ defmodule Philomena.Repo.Migrations.ProdSchemaSync20200617 do
use Ecto.Migration
def change do
# execute("CREATE INDEX index_comments_on_image_id_and_created_at ON public.comments USING btree (image_id, created_at);")
# execute("DROP INDEX index_dnp_entries_on_modifying_user_id;")
# execute("CREATE INDEX index_dnp_entries_on_aasm_state_filtered ON public.dnp_entries USING btree (aasm_state) WHERE ((aasm_state)::text = ANY (ARRAY[('requested'::character varying)::text, ('claimed'::character varying)::text, ('rescinded'::character varying)::text, ('acknowledged'::character varying)::text]));")
# execute("CREATE INDEX index_duplicate_reports_on_state_filtered ON public.duplicate_reports USING btree (state) WHERE ((state)::text = ANY (ARRAY[('open'::character varying)::text, ('claimed'::character varying)::text]));")
# execute("CREATE INDEX index_filters_on_name ON public.filters USING btree (name);")
# execute("CREATE INDEX index_filters_on_system ON public.filters USING btree (system) WHERE (system = true);")
# execute("CREATE UNIQUE INDEX index_gallery_interactions_on_gallery_id_and_image_id ON public.gallery_interactions USING btree (gallery_id, image_id);")
# execute("CREATE INDEX index_gallery_interactions_on_gallery_id_and_position ON public.gallery_interactions USING btree (gallery_id, \"position\");")
# execute("DROP INDEX index_images_on_first_seen_at;")
# execute("DROP INDEX index_notifications_on_actor_id_and_actor_type;")
# execute("CREATE UNIQUE INDEX index_notifications_on_actor_id_and_actor_type ON public.notifications USING btree (actor_id, actor_type);")
# execute("CREATE INDEX index_subnet_bans_on_specification ON public.subnet_bans USING gist (specification inet_ops);")
# execute("CREATE INDEX index_tag_changes_on_fingerprint ON public.tag_changes USING btree (fingerprint);")
# execute("CREATE INDEX index_tag_changes_on_ip ON public.tag_changes USING gist (ip inet_ops);")
# execute("DROP INDEX index_tags_on_name;")
# execute("CREATE UNIQUE INDEX index_tags_on_name ON public.tags USING btree (name);")
# execute("DROP INDEX index_tags_on_slug;")
# execute("CREATE UNIQUE INDEX index_tags_on_slug ON public.tags USING btree (slug);")
# execute("DROP INDEX index_topics_on_sticky;")
# execute("DROP INDEX index_user_bans_on_created_at;")
# execute("CREATE INDEX index_user_bans_on_created_at ON public.user_bans USING btree (created_at DESC);")
# execute("DROP INDEX index_users_on_name;")
# execute("CREATE UNIQUE INDEX index_users_on_name ON public.users USING btree (name);")
# execute("DROP INDEX index_users_on_slug;")
# execute("CREATE UNIQUE INDEX index_users_on_slug ON public.users USING btree (slug)")
# execute("CREATE INDEX index_users_on_watched_tag_ids ON public.users USING gin (watched_tag_ids);")
# execute("DROP INDEX index_adverts_on_live;")
# execute("DROP INDEX index_commissions_on_categories;")
execute("CREATE INDEX index_comments_on_image_id_and_created_at ON public.comments USING btree (image_id, created_at);")
execute("DROP INDEX index_dnp_entries_on_modifying_user_id;")
execute("CREATE INDEX index_dnp_entries_on_aasm_state_filtered ON public.dnp_entries USING btree (aasm_state) WHERE ((aasm_state)::text = ANY (ARRAY[('requested'::character varying)::text, ('claimed'::character varying)::text, ('rescinded'::character varying)::text, ('acknowledged'::character varying)::text]));")
execute("CREATE INDEX index_duplicate_reports_on_state_filtered ON public.duplicate_reports USING btree (state) WHERE ((state)::text = ANY (ARRAY[('open'::character varying)::text, ('claimed'::character varying)::text]));")
execute("CREATE INDEX index_filters_on_name ON public.filters USING btree (name);")
execute("CREATE INDEX index_filters_on_system ON public.filters USING btree (system) WHERE (system = true);")
execute("CREATE UNIQUE INDEX index_gallery_interactions_on_gallery_id_and_image_id ON public.gallery_interactions USING btree (gallery_id, image_id);")
execute("CREATE INDEX index_gallery_interactions_on_gallery_id_and_position ON public.gallery_interactions USING btree (gallery_id, \"position\");")
execute("DROP INDEX index_images_on_first_seen_at;")
execute("DROP INDEX index_notifications_on_actor_id_and_actor_type;")
execute("CREATE UNIQUE INDEX index_notifications_on_actor_id_and_actor_type ON public.notifications USING btree (actor_id, actor_type);")
execute("CREATE INDEX index_subnet_bans_on_specification ON public.subnet_bans USING gist (specification inet_ops);")
execute("CREATE INDEX index_tag_changes_on_fingerprint ON public.tag_changes USING btree (fingerprint);")
execute("CREATE INDEX index_tag_changes_on_ip ON public.tag_changes USING gist (ip inet_ops);")
execute("DROP INDEX index_tags_on_name;")
execute("CREATE UNIQUE INDEX index_tags_on_name ON public.tags USING btree (name);")
execute("DROP INDEX index_tags_on_slug;")
execute("CREATE UNIQUE INDEX index_tags_on_slug ON public.tags USING btree (slug);")
execute("DROP INDEX index_topics_on_sticky;")
execute("DROP INDEX index_user_bans_on_created_at;")
execute("CREATE INDEX index_user_bans_on_created_at ON public.user_bans USING btree (created_at DESC);")
execute("DROP INDEX index_users_on_name;")
execute("CREATE UNIQUE INDEX index_users_on_name ON public.users USING btree (name);")
execute("DROP INDEX index_users_on_slug;")
execute("CREATE UNIQUE INDEX index_users_on_slug ON public.users USING btree (slug)")
execute("CREATE INDEX index_users_on_watched_tag_ids ON public.users USING gin (watched_tag_ids);")
execute("DROP INDEX index_adverts_on_live;")
execute("DROP INDEX index_commissions_on_categories;")
end
end

View file

@ -2,52 +2,52 @@ defmodule Philomena.Repo.Migrations.ProdSchemaSync2 do
use Ecto.Migration
def change do
# execute("DROP TABLE ar_internal_metadata;")
# execute("ALTER SEQUENCE adverts_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE badge_awards_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE badges_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE channels_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE comments_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE commission_items_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE commissions_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE conversations_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE dnp_entries_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE donations_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE duplicate_reports_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE filters_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE fingerprint_bans_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE forums_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE galleries_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE gallery_interactions_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE images_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE messages_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE mod_notes_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE notifications_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE poll_options_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE poll_votes_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE polls_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE posts_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE reports_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE roles_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE site_notices_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE source_changes_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE subnet_bans_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE tag_changes_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE tags_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE topics_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE unread_notifications_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE user_bans_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE user_fingerprints_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE user_ips_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE user_links_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE user_name_changes_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE user_statistics_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE user_whitelists_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE users_id_seq AS BIGINT;")
# execute("ALTER SEQUENCE versions_id_seq AS BIGINT;")
# execute("CREATE INDEX index_users_on_created_at ON public.users USING btree (created_at);")
# execute("CREATE INDEX index_users_on_role ON public.users USING btree (role) WHERE ((role)::text <> 'user'::text);")
# execute("DROP INDEX temp_unique_index_tags_on_name;")
# execute("DROP INDEX temp_unique_index_tags_on_slug;")
execute("DROP TABLE ar_internal_metadata;")
execute("ALTER SEQUENCE adverts_id_seq AS BIGINT;")
execute("ALTER SEQUENCE badge_awards_id_seq AS BIGINT;")
execute("ALTER SEQUENCE badges_id_seq AS BIGINT;")
execute("ALTER SEQUENCE channels_id_seq AS BIGINT;")
execute("ALTER SEQUENCE comments_id_seq AS BIGINT;")
execute("ALTER SEQUENCE commission_items_id_seq AS BIGINT;")
execute("ALTER SEQUENCE commissions_id_seq AS BIGINT;")
execute("ALTER SEQUENCE conversations_id_seq AS BIGINT;")
execute("ALTER SEQUENCE dnp_entries_id_seq AS BIGINT;")
execute("ALTER SEQUENCE donations_id_seq AS BIGINT;")
execute("ALTER SEQUENCE duplicate_reports_id_seq AS BIGINT;")
execute("ALTER SEQUENCE filters_id_seq AS BIGINT;")
execute("ALTER SEQUENCE fingerprint_bans_id_seq AS BIGINT;")
execute("ALTER SEQUENCE forums_id_seq AS BIGINT;")
execute("ALTER SEQUENCE galleries_id_seq AS BIGINT;")
execute("ALTER SEQUENCE gallery_interactions_id_seq AS BIGINT;")
execute("ALTER SEQUENCE images_id_seq AS BIGINT;")
execute("ALTER SEQUENCE messages_id_seq AS BIGINT;")
execute("ALTER SEQUENCE mod_notes_id_seq AS BIGINT;")
execute("ALTER SEQUENCE notifications_id_seq AS BIGINT;")
execute("ALTER SEQUENCE poll_options_id_seq AS BIGINT;")
execute("ALTER SEQUENCE poll_votes_id_seq AS BIGINT;")
execute("ALTER SEQUENCE polls_id_seq AS BIGINT;")
execute("ALTER SEQUENCE posts_id_seq AS BIGINT;")
execute("ALTER SEQUENCE reports_id_seq AS BIGINT;")
execute("ALTER SEQUENCE roles_id_seq AS BIGINT;")
execute("ALTER SEQUENCE site_notices_id_seq AS BIGINT;")
execute("ALTER SEQUENCE source_changes_id_seq AS BIGINT;")
execute("ALTER SEQUENCE subnet_bans_id_seq AS BIGINT;")
execute("ALTER SEQUENCE tag_changes_id_seq AS BIGINT;")
execute("ALTER SEQUENCE tags_id_seq AS BIGINT;")
execute("ALTER SEQUENCE topics_id_seq AS BIGINT;")
execute("ALTER SEQUENCE unread_notifications_id_seq AS BIGINT;")
execute("ALTER SEQUENCE user_bans_id_seq AS BIGINT;")
execute("ALTER SEQUENCE user_fingerprints_id_seq AS BIGINT;")
execute("ALTER SEQUENCE user_ips_id_seq AS BIGINT;")
execute("ALTER SEQUENCE user_links_id_seq AS BIGINT;")
execute("ALTER SEQUENCE user_name_changes_id_seq AS BIGINT;")
execute("ALTER SEQUENCE user_statistics_id_seq AS BIGINT;")
execute("ALTER SEQUENCE user_whitelists_id_seq AS BIGINT;")
execute("ALTER SEQUENCE users_id_seq AS BIGINT;")
execute("ALTER SEQUENCE versions_id_seq AS BIGINT;")
execute("CREATE INDEX index_users_on_created_at ON public.users USING btree (created_at);")
execute("CREATE INDEX index_users_on_role ON public.users USING btree (role) WHERE ((role)::text <> 'user'::text);")
execute("DROP INDEX temp_unique_index_tags_on_name;")
execute("DROP INDEX temp_unique_index_tags_on_slug;")
end
end