Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Delete users from sql, auth_user
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ben Copeland  
View profile   Translate to Translated (View Original)
 More options Oct 25 2012, 5:41 am
From: Ben Copeland <ben.comob...@gmail.com>
Date: Thu, 25 Oct 2012 02:41:36 -0700 (PDT)
Local: Thurs, Oct 25 2012 5:41 am
Subject: Delete users from sql, auth_user

Hello all,

I am writing a custom script so users can be added and deleted from
reviewboard. However how can I delete a user from auth_user, because I got
problems with the foreign key constraint.

I am writing the script in php/mysql.

Cannot delete or update a parent row: a foreign key constraint fails
(`reviewboard`.`accounts_profile`, CONSTRAINT `user_id_refs_id_46e869e2`
FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`))

What sql code would I need to delete, or make sure the user and history are
deleted properly?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Trowbridge  
View profile  
 More options Oct 25 2012, 4:28 pm
From: David Trowbridge <trowb...@gmail.com>
Date: Thu, 25 Oct 2012 13:28:15 -0700
Local: Thurs, Oct 25 2012 4:28 pm
Subject: Re: Delete users from sql, auth_user
Can you clarify why you want to do this? As you've noted, review board
really isn't designed to have users be deleted entirely.

As an aside, it's going to be much, much easier to write these sorts
of scripts as django management commands than to try to do it
operating directly on the database.

-David


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Johnson  
View profile  
 More options Oct 25 2012, 9:43 pm
From: Eric Johnson <one.eric.john...@gmail.com>
Date: Thu, 25 Oct 2012 18:43:38 -0700
Local: Thurs, Oct 25 2012 9:43 pm
Subject: Re: Delete users from sql, auth_user
I'd add that it is unlikely that you really want to delete all traces of a user in ReviewBoard history. If you need to deactivate an account, why not just do that?

Eric

Sent from my iPad

On Oct 25, 2012, at 1:28 PM, David Trowbridge <trowb...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Copeland  
View profile  
 More options Dec 18 2012, 6:07 am
From: Ben Copeland <ben.comob...@gmail.com>
Date: Tue, 18 Dec 2012 03:07:48 -0800 (PST)
Local: Tues, Dec 18 2012 6:07 am
Subject: Re: Delete users from sql, auth_user

Hello,

I import users from active directory using ldap. I do this because users
are not populated in reviewboard from AD. We add and remove many users from
our system, so it is easier if this process was linked via a sync method.
So if users are deleted, added or have a name change reviewboard can
replicate this.

Currently users are added into reviewboard but we manually delete them. I
am able to SET FOREIGN_KEY_CHECKS=0 and then delete, then set it back to 1,
however this is a shortcut?

I'm not familiar with django management commands. Can you control users
through it?

Regards


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Johnson  
View profile  
 More options Dec 19 2012, 2:12 am
From: Eric Johnson <ericjohn...@alumni.brown.edu>
Date: Tue, 18 Dec 2012 23:12:39 -0800
Local: Wed, Dec 19 2012 2:12 am
Subject: Re: Delete users from sql, auth_user
Hi Ben,

I've resorted to a similar approach to automatically updating the
database with users.

However, unlike you,it appears, I take a more conservative approach, and
never *delete* users. Rather, I mark them as inactive. That way, you
don't have to worry about foreign key constraints.

Eric

On 12/18/12 3:07 AM, Ben Copeland wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »