Hello All.
I'm having this console output
Illuminate\Database\QueryException
Error Code : 957
Error Message : ORA-00957: duplicate column name
Position : 239
Statement : create table user_authentication ( id number(19,0) not null, autenticacion_tipo_id number(19,0) not null, nivel_auth varchar2(255) not null, fecha_autenticacion timestamp not null, updated_at timestamp not null, created_at timestamp null, updated_at timestamp null, constraint user_authentication_id_fk foreign key ( id ) references users ( id ) on delete cascade, constraint us_authentic_autentic_ti_id_fk foreign key ( autenticacion_tipo_id ) references authentication_types ( id ) on delete cascade, constraint user_authentication_id_pk primary key ( id ) )
Bindings : []
(SQL: create table user_authentication ( id number(19,0) not null, autenticacion_tipo_id number(19,0) not null, nivel_auth varchar2(255) not null, fecha_autenticacion timestamp not null, updated_at timestamp not null, created_at timestamp null, updated_at timestamp null, constraint user_authentication_id_fk foreign key ( id ) references users ( id ) on delete cascade, constraint us_authentic_autentic_ti_id_fk foreign key ( autenticacion_tipo_id ) references authentication_types ( id ) on delete cascade, constraint user_authentication_id_pk primary key ( id ) ))
This is the user migration:
$a = Schema::create('users', function (Blueprint $table) {
$table->id()->primary();
$table->bigInteger('cuil')->unique();
$table->bigInteger('prs_id')->unique();
$table->string('email');
$table->string('password');
$table->string('nombre');
$table->string('apellido');
$table->timestamp('email_verified_at')->nullable();
$table->rememberToken();
$table->timestamps();
});
user_contact migrations:
Schema::create('user_contact', function (Blueprint $table) {
$table->id()->primary();
$table->foreign('id')->references('id')->on('users')->onDelete('cascade');
$table->string("email")->unique();
$table->string("fecha_nacimiento");
$table->string("celular");
$table->string("departamento_id");
$table->string("localidad_id");
$table->string("domicilio");
$table->string("numero");
$table->timestamps();
$table->softDeletes();
});
and this is the user_authentication tables which has the problem
Schema::create('user_authentication', function (Blueprint $table) {
$table->id()->primary();
$table->foreign('id')->references('id')->on('users')->onDelete('cascade');
$table->bigInteger("autenticacion_tipo_id");
$table->foreign('autenticacion_tipo_id')->references('id')->on('authentication_types')->onDelete('cascade');
$table->string("nivel_auth");
$table->timestamp("fecha_autenticacion");
$table->timestamp("updated_at");
$table->timestamps();
});
I can't find where it is duplicated.
Could it be the problem that more than one table has this line?
$table->foreign('id')->references('id')->on('users')->onDelete('cascade');