mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Merge branch 'registry-700' into registry-694
# Conflicts: # db/structure.sql
This commit is contained in:
commit
709dba7664
54 changed files with 535 additions and 274 deletions
|
@ -0,0 +1,5 @@
|
|||
class ChangeEppSessionsSessionIdToNotNull < ActiveRecord::Migration
|
||||
def change
|
||||
change_column_null :epp_sessions, :session_id, false
|
||||
end
|
||||
end
|
5
db/migrate/20180206234620_add_epp_sessions_user_id.rb
Normal file
5
db/migrate/20180206234620_add_epp_sessions_user_id.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddEppSessionsUserId < ActiveRecord::Migration
|
||||
def change
|
||||
add_reference :epp_sessions, :user, foreign_key: true
|
||||
end
|
||||
end
|
|
@ -0,0 +1,10 @@
|
|||
class ExtractUserIdFromEppSessionsData < ActiveRecord::Migration
|
||||
def change
|
||||
EppSession.all.each do |epp_session|
|
||||
user_id = Marshal.load(::Base64.decode64(epp_session.data_before_type_cast))[:api_user_id]
|
||||
user = ApiUser.find(user_id)
|
||||
epp_session.user = user
|
||||
epp_session.save!
|
||||
end
|
||||
end
|
||||
end
|
5
db/migrate/20180207072139_remove_epp_sessions_data.rb
Normal file
5
db/migrate/20180207072139_remove_epp_sessions_data.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class RemoveEppSessionsData < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :epp_sessions, :data, :string
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class RemoveEppSessionsRegistrarId < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :epp_sessions, :registrar_id, :integer
|
||||
end
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
class AddEppSessionsSessionIdUniqueConstraint < ActiveRecord::Migration
|
||||
def up
|
||||
execute <<-SQL
|
||||
ALTER TABLE epp_sessions ADD CONSTRAINT unique_session_id UNIQUE (session_id)
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<-SQL
|
||||
ALTER TABLE epp_sessions DROP CONSTRAINT unique_session_id
|
||||
SQL
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class RemoveEppSessionsSessionIdUniqueIndex < ActiveRecord::Migration
|
||||
def change
|
||||
remove_index :epp_sessions, name: :index_epp_sessions_on_session_id
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class ChangeEppSessionsUserIdToNotNull < ActiveRecord::Migration
|
||||
def change
|
||||
change_column_null :epp_sessions, :user_id, false
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue