cartodb/db/migrate/20180208132723_unique_tokens_per_user.rb

25 lines
503 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 :db_role
add_index [:user_id, :db_role], unique: true
drop_index :token
add_index [:user_id, :token], unique: true
end
end,
Proc.new do
alter_table :api_keys do
drop_index [:user_id, :db_role]
add_index :db_role, unique: true
drop_index [:user_id, :token]
add_index :token, unique: true
end
end
)