New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Your Account is Banned message when creating accounts via seeding #48
Comments
Are you specifically setting the status column in the seed to 2? |
No, actually I don't set the status column at all. Thanks in advance for the help. Do I need to go ahead and set status? Here is what I am doing in the seeder: 'test', 'username' => 'Admin', 'email' => 'test@mailinator.com', 'password' => bcrypt('fakepass'), 'confirmation_code' => md5(uniqid(mt_rand(), true)), 'confirmed' => true, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ], [ 'name' => 'Default User', 'username' => 'Tester', 'email' => 'test2@mailinator.com', 'password' => bcrypt('fakepass2'), 'confirmation_code' => md5(uniqid(mt_rand(), true)), 'confirmed' => true, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ], ]; DB::table(config('auth.table'))->insert($users); } ``` } |
The 4th migration setup_access_tables, installs the status column, did you run all of the migrations? |
I do indeed have that in my migrations. I did have to modify things as I am using postgres. Here is what I have in that file: boolean('status')->after('password')->default(true); }); Schema::create(config('access.roles_table'), function ($table) { $table->increments('id')->unsigned(); $table->string('name')->unique(); $table->timestamps(); }); Schema::create(config('access.assigned_roles_table'), function ($table) { $table->increments('id')->unsigned(); $table->integer('user_id')->unsigned(); $table->integer('role_id')->unsigned(); $table->foreign('user_id') ->references('id') ->on(config('auth.table')) ->onUpdate('cascade') ->onDelete('cascade'); $table->foreign('role_id')->references('id')->on(config('access.roles_table')); }); Schema::create(config('access.permissions_table'), function ($table) { $table->increments('id')->unsigned(); $table->string('name')->unique(); $table->string('display_name'); $table->boolean('system')->default(false); $table->timestamps(); }); Schema::create(config('access.permission_role_table'), function ($table) { $table->increments('id')->unsigned(); $table->integer('permission_id')->unsigned(); $table->integer('role_id')->unsigned(); $table->foreign('permission_id') ->references('id') ->on(config('access.permissions_table')); $table->foreign('role_id') ->references('id') ->on(config('access.roles_table')); }); Schema::create(config('access.permission_user_table'), function ($table) { $table->increments('id')->unsigned(); $table->integer('permission_id')->unsigned(); $table->integer('user_id')->unsigned(); $table->foreign('permission_id') ->references('id') ->on(config('access.permissions_table')); $table->foreign('user_id') ->references('id') ->on(config('auth.table')); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table(config('auth.table'), function(Blueprint $table) { $table->dropColumn('status'); }); Schema::table(config('access.assigned_roles_table'), function (Blueprint $table) { $table->dropForeign(config('access.assigned_roles_table').'_user_id_foreign'); $table->dropForeign(config('access.assigned_roles_table').'_role_id_foreign'); }); Schema::table(config('access.permission_role_table'), function (Blueprint $table) { $table->dropForeign(config('access.permission_role_table').'_permission_id_foreign'); $table->dropForeign(config('access.permission_role_table').'_role_id_foreign'); }); Schema::table(config('access.permission_user_table'), function (Blueprint $table) { $table->dropForeign(config('access.permission_user_table').'_permission_id_foreign'); $table->dropForeign(config('access.permission_user_table').'_user_id_foreign'); }); Schema::drop(config('access.assigned_roles_table')); Schema::drop(config('access.permission_role_table')); Schema::drop(config('access.permission_user_table')); Schema::drop(config('access.roles_table')); Schema::drop(config('access.permissions_table')); } ``` } |
I did find status in the tables, it is set to TRUE for both users. |
There should be no reason that message is being thrown while seeding. |
I got this issue too when using PostgreSQL, related to I do comment these statement, because on postgresql these not supported
and
I try this |
to solved this banned issue on PostgreSQL I change status type to integer instead of boolean |
Thanks Azulkipli, I made that change it and worked. |
I have fixed all of this with this commit: 57a3603 |
I am getting this message automatically when I create accounts via seeding, I looked around in the database and I don't see a 'status' field that is set to 2. How can I either fix the problem in the seeding itself or easily unban these accounts without going through the password reset steps.
The text was updated successfully, but these errors were encountered: