From 5c2e5fd62ee217880f8881f338a2db8130d37b06 Mon Sep 17 00:00:00 2001 From: f Date: Sun, 26 Sep 2021 19:29:03 -0300 Subject: [PATCH] =?UTF-8?q?Agregar=20=C3=ADndices=20=C3=BAnicos=20que=20pe?= =?UTF-8?q?ns=C3=A1bamos=20que=20ten=C3=ADamos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `unique: true` es un parámetro de `add_index` no de `add_column`. --- db/migrate/20210926205448_add_uniqueness.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 db/migrate/20210926205448_add_uniqueness.rb diff --git a/db/migrate/20210926205448_add_uniqueness.rb b/db/migrate/20210926205448_add_uniqueness.rb new file mode 100644 index 00000000..7399ba4c --- /dev/null +++ b/db/migrate/20210926205448_add_uniqueness.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# Agrega índices únicos que pensábamos que ya existían. +class AddUniqueness < ActiveRecord::Migration[6.1] + def change + add_index :designs, :name, unique: true + add_index :designs, :gem, unique: true + add_index :licencias, :name, unique: true + end +end