提交 163e9f99 编写于 作者: G Grzegorz Bizon

Fix indexes in container repositories table

上级 6d7a5248
......@@ -5,13 +5,12 @@ class CreateContainerRepository < ActiveRecord::Migration
def change
create_table :container_repositories do |t|
t.references :project, foreign_key: true, null: false
t.references :project, foreign_key: true, index: true, null: false
t.string :name, null: false
t.timestamps null: false
end
add_index :container_repositories, :project_id
add_index :container_repositories, [:project_id, :name], unique: true
end
end
......@@ -21,13 +21,6 @@ describe ContainerRepository do
headers: { 'Content-Type' => 'application/json' })
end
describe 'validations' do
it 'validates uniqueness of name scoped to project' do
expect(subject).to validate_uniqueness_of(:name)
.scoped_to(:project_id)
end
end
describe 'associations' do
it 'belongs to the project' do
expect(container_repository).to belong_to(:project)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册