Skip to content

Commit

Permalink
Test building a partial index (with 'where')
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanl committed Sep 21, 2018
1 parent 4161369 commit 92e8a5f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/ecto/migration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 54,8 @@ defmodule Ecto.MigrationTest do
%Index{table: "posts", unique: false, name: :posts_lower_title_index, columns: ["lower(title)"]}
assert index(:posts, [:title], name: :foo, unique: true) ==
%Index{table: "posts", unique: true, name: :foo, columns: [:title]}
assert index(:posts, [:title], where: "status = 'published'", name: :published_posts_title_index, unique: true) ==
%Index{table: "posts", unique: true, where: "status = 'published'", name: :published_posts_title_index, columns: [:title]}
assert unique_index(:posts, [:title], name: :foo) ==
%Index{table: "posts", unique: true, name: :foo, columns: [:title]}
assert unique_index(:posts, :title, name: :foo) ==
Expand Down

0 comments on commit 92e8a5f

Please sign in to comment.