Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
610bc76ad7
@ -0,0 +1,5 @@
|
||||
<% if @message.present? %>
|
||||
$.notify({ message: "<%= @message %>" });
|
||||
<% else %>
|
||||
$(".discipline-list-container").html("<%= j(render :partial => 'admins/disciplines/shared/list') %>");
|
||||
<% end %>
|
@ -0,0 +1 @@
|
||||
$(".salesman-customer-list-container").html("<%= j(render partial: 'admins/salesman_customers/shared/list') %>")
|
@ -0,0 +1,5 @@
|
||||
<% if @message.present? %>
|
||||
$.notify({ message: "<%= @message %>" });
|
||||
<% else %>
|
||||
$(".sub-discipline-list-container").html("<%= j(render :partial => 'admins/sub_disciplines/shared/list') %>");
|
||||
<% end %>
|
@ -0,0 +1,5 @@
|
||||
<% if @message.present? %>
|
||||
$.notify({ message: "<%= @message %>" });
|
||||
<% else %>
|
||||
$(".tag-discipline-list-container").html("<%= j(render :partial => 'admins/tag_disciplines/shared/list') %>");
|
||||
<% end %>
|
@ -0,0 +1,7 @@
|
||||
class AddPositionToDiscipline < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :disciplines, :position, :integer, default: 0
|
||||
add_column :sub_disciplines, :position, :integer, default: 0
|
||||
add_column :tag_disciplines, :position, :integer, default: 0
|
||||
end
|
||||
end
|
@ -0,0 +1,15 @@
|
||||
class MigrateDisciplinePosition < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
Discipline.all.each_with_index do |discipline, i|
|
||||
discipline.update_column("position", i + 1)
|
||||
|
||||
discipline.sub_disciplines.each_with_index do |sub, j|
|
||||
sub.update_column("position", j + 1)
|
||||
|
||||
sub.tag_disciplines.each_with_index do |tag, k|
|
||||
tag.update_column("position", k + 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class AddUniqIndexToSalesmanChannel < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
sql = %Q(delete from salesman_channels where (salesman_id, school_id) in
|
||||
(select * from (select salesman_id, school_id from salesman_channels group by salesman_id, school_id having count(*) > 1) a)
|
||||
and id not in (select * from (select min(id) from salesman_channels group by salesman_id, school_id having count(*) > 1 order by id) b))
|
||||
ActiveRecord::Base.connection.execute sql
|
||||
|
||||
add_index :salesman_channels, [:salesman_id, :school_id], unique: true
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class AddUniqIndexToSalesmanCustomer < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
sql = %Q(delete from salesman_customers where (salesman_id, user_id) in
|
||||
(select * from (select salesman_id, user_id from salesman_customers group by salesman_id, user_id having count(*) > 1) a)
|
||||
and id not in (select * from (select min(id) from salesman_customers group by salesman_id, user_id having count(*) > 1 order by id) b))
|
||||
ActiveRecord::Base.connection.execute sql
|
||||
|
||||
add_index :salesman_customers, [:salesman_id, :user_id], unique: true
|
||||
end
|
||||
end
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in new issue