forked from e621ng/e621ng
Make user_id column unique on user_statuses
This commit is contained in:
parent
b5f6b6d422
commit
4fe2e02fa4
11
db/migrate/20190827223818_add_user_status_indexing.rb
Normal file
11
db/migrate/20190827223818_add_user_status_indexing.rb
Normal file
@ -0,0 +1,11 @@
|
||||
class AddUserStatusIndexing < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
remove_index :user_statuses, :user_id
|
||||
add_index :user_statuses, :user_id, unique: true
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :user_statuses, :user_id
|
||||
add_index :user_statuses, :user_id
|
||||
end
|
||||
end
|
@ -4866,7 +4866,7 @@ CREATE INDEX index_user_name_change_requests_on_user_id ON public.user_name_chan
|
||||
-- Name: index_user_statuses_on_user_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX index_user_statuses_on_user_id ON public.user_statuses USING btree (user_id);
|
||||
CREATE UNIQUE INDEX index_user_statuses_on_user_id ON public.user_statuses USING btree (user_id);
|
||||
|
||||
|
||||
--
|
||||
@ -5246,6 +5246,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
||||
('20190801210547'),
|
||||
('20190804010156'),
|
||||
('20190810064211'),
|
||||
('20190815131908');
|
||||
('20190815131908'),
|
||||
('20190827223818');
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user