Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy recent landing page changes to atlos.org #1000

Open
wants to merge 3 commits into
base: deployments/landing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/lib/platform_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defmodule PlatformWeb.Endpoint do
plug(Plug.Telemetry, event_prefix: [:phoenix, :endpoint])

plug(Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
parsers: [:urlencoded, {:multipart, length: 2_000_000_000}, :json],
pass: ["*/*"],
json_decoder: Phoenix.json_library()
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
defmodule Platform.Repo.Migrations.MoveDescriptionToTextField do
use Ecto.Migration

def change do
# Drop the 'searchable' column from the 'media' table
execute "ALTER TABLE media DROP COLUMN searchable;"

alter table(:media) do
modify :attr_description, :text
end

# Add the 'searchable' column to the 'media' table
execute """
ALTER TABLE media
ADD COLUMN searchable tsvector
GENERATED ALWAYS AS (
setweight(to_tsvector('simple', coalesce(slug, '')), 'A') ||
setweight(to_tsvector('simple', coalesce(attr_description, '')), 'A') ||
setweight(to_tsvector('simple', coalesce(attr_more_info, '')), 'B') ||
setweight(to_tsvector('simple', coalesce(attr_general_location, '')), 'C') ||
setweight(to_tsvector('simple', imm_array_to_string(attr_restrictions, ' ', ' ')), 'C') ||
setweight(to_tsvector('simple', imm_array_to_string(attr_sensitive, ' ', ' ')), 'C') ||
setweight(to_tsvector('simple', coalesce(attr_status, '')), 'C') ||
setweight(jsonb_to_tsvector('simple', coalesce(auto_metadata, '{}'), '"string"'), 'D')
) STORED
""",
""

# Add an index to the 'media' table on searchable
create index(:media, ["searchable"], using: "GIN")
end
end
Loading