diff --git a/migrations/04-users-permissions.sql b/migrations/04-users-permissions.sql new file mode 100644 index 000000000..94db6a1ed --- /dev/null +++ b/migrations/04-users-permissions.sql @@ -0,0 +1,14 @@ +-- Migrate the users first +INSERT IGNORE INTO auth_user (id, username, first_name, last_name, + email, password, is_staff, is_active, + is_superuser, last_login, date_joined) + SELECT users_users.userId, users_users.login, '', '', + users_users.email, '', 0, 1, 0, + FROM_UNIXTIME(users_users.registrationDate), + FROM_UNIXTIME(users_users.registrationDate) + FROM users_users; + +INSERT INTO auth_group (id, name) + VALUES (1, 'Forum Moderators'); + +UPDATE auth_user SET password = ''; diff --git a/migrations/05-groups.sql b/migrations/05-groups.sql new file mode 100644 index 000000000..8ff5fcc6b --- /dev/null +++ b/migrations/05-groups.sql @@ -0,0 +1,25 @@ +INSERT IGNORE INTO auth_user_groups (id, user_id, group_id) + SELECT NULL, users_users.userId, 1 + FROM users_users, users_usergroups + WHERE users_users.userId = users_usergroups.userId + AND users_usergroups.groupName = 'Forum Moderators'; + +INSERT INTO authority_permission + VALUES + (NULL,'forums_forum.thread_edit_forum',14,1,NULL,1,47963,1, + '2010-05-20 10:37:22','2010-05-20 10:39:57'), + (NULL,'forums_forum.thread_delete_forum',14,1,NULL,1,47963,1, + '2010-05-20 10:37:22','2010-05-20 10:37:22'), + (NULL,'forums_forum.thread_sticky_forum',14,1,NULL,1,47963,1, + '2010-05-20 10:37:22','2010-05-20 10:37:22'), + (NULL,'forums_forum.post_edit_forum',14,1,NULL,1,47963,1, + '2010-05-20 10:37:22','2010-05-20 10:37:22'), + (NULL,'forums_forum.post_delete_forum',14,1,NULL,1,47963,1, + '2010-05-20 10:37:22','2010-05-20 10:37:22'); + +UPDATE auth_user + SET is_superuser = 1, is_staff = 1 + WHERE id IN (SELECT users_users.userId + FROM users_users, users_usergroups + WHERE users_users.userId = users_usergroups.userId + AND users_usergroups.groupName = 'System Admins');