Skip to content

Commit

Permalink
Drop unique app name index
Browse files Browse the repository at this point in the history
It is possible two apps share the same name, however the package is the
only thing that will stay unique. So we can safely drop the unique name
db constraint, and let apps get added that are the same name. They will
look different in most cases due to image/package.
  • Loading branch information
tomkonidas committed Jul 15, 2024
1 parent e28c7c3 commit de98fb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/plexus/schemas/app.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ defmodule Plexus.Schemas.App do
app
|> cast(params, [:package, :name, :icon_url])
|> validate_required([:package, :name])
|> unique_constraint(:name)
|> unique_constraint(:package, name: :apps_pkey)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defmodule Plexus.Repo.Migrations.RemoveAppsNameUniqueIndex do
use Ecto.Migration

def change do
drop_if_exists index(:apps, [:name])
end
end

0 comments on commit de98fb0

Please sign in to comment.