Import lithium roles into groups

This commit is contained in:
Vinoth Kannan 2018-05-16 17:26:15 +05:30
parent 5e97a9bfb7
commit ade7c94b43
1 changed files with 6 additions and 5 deletions

View File

@ -53,6 +53,7 @@ class ImportScripts::Lithium < ImportScripts::Base
@max_start_id = Post.maximum(:id)
import_groups
import_categories
import_users
import_topics
@ -70,15 +71,15 @@ class ImportScripts::Lithium < ImportScripts::Base
puts "", "importing groups..."
groups = mysql_query <<-SQL
SELECT usergroupid, title
FROM usergroup
ORDER BY usergroupid
SELECT DISTINCT name
FROM roles
ORDER BY name
SQL
create_groups(groups) do |group|
{
id: group["usergroupid"],
name: @htmlentities.decode(group["title"]).strip
id: group["name"],
name: @htmlentities.decode(group["name"]).strip
}
end
end