I'm using psql in my Laravel App. I'm trying to create my user, and I keep getting this error
Unique violation: 7 ERROR: duplicate key value violates unique constraint "users_pkey"
Here what I did to store my user
$user = User::where('account_id','=',$id)->first();
$user->email = $account->email_address;
$user->fb_email = '';
$user->tw_email = '';
$user->fb_access_token = '';
$user->fb_profile_id = '';
$user->fb_page_id = '';
$user->fb_username = '';
$user->save();
Here is how I created my users table
CREATE TABLE "users" (
"id" serial NOT NULL ,
"account_id" varchar(255) NOT NULL ,
"email" varchar(255) NOT NULL ,
"fb_email" varchar(255) NOT NULL ,
"tw_email" varchar(255) NOT NULL ,
"created_at" timestamp(0) without time zone,
"updated_at" timestamp(0) without time zone,
"fb_access_token" varchar(255) NOT NULL ,
"fb_profile_id" varchar(255) NOT NULL ,
"fb_page_id" varchar(255) NOT NULL ,
"fb_username" varchar(255) NOT NULL ,
PRIMARY KEY ("id")
);
Did I do anything that I'm not
suppose to?
What I am having right now used to work when I hook my app with MySQL
.
Any hints / suggestions will mean a lot to me.