cartodb/db/migrate/20180115110000_add_name_index_to_api_key.rb

19 lines
335 B
Ruby
Raw Normal View History

2020-06-15 10:58:47 +08:00
require 'carto/db/migration_helper'
include Carto::Db::MigrationHelper
migration(
Proc.new do
alter_table :api_keys do
drop_index :user_id
add_index [:user_id, :name], unique: true
end
end,
Proc.new do
alter_table :api_keys do
drop_index [:user_id, :name]
add_index :user_id
end
end
)