GithubHelp home page GithubHelp logo

Comments (10)

rappasoft avatar rappasoft commented on May 3, 2024

Are you specifically setting the status column in the seed to 2?

from laravel-boilerplate.

kobescoresagain avatar kobescoresagain commented on May 3, 2024

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' => '[email protected]', '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' => '[email protected]', '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); } ``` }

from laravel-boilerplate.

rappasoft avatar rappasoft commented on May 3, 2024

The 4th migration setup_access_tables, installs the status column, did you run all of the migrations?

from laravel-boilerplate.

kobescoresagain avatar kobescoresagain commented on May 3, 2024

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')); } ``` }

from laravel-boilerplate.

kobescoresagain avatar kobescoresagain commented on May 3, 2024

I did find status in the tables, it is set to TRUE for both users.

from laravel-boilerplate.

rappasoft avatar rappasoft commented on May 3, 2024

There should be no reason that message is being thrown while seeding.

from laravel-boilerplate.

azulkipli avatar azulkipli commented on May 3, 2024

I got this issue too when using PostgreSQL, related to
#51

I do comment these statement, because on postgresql these not supported

DB::statement('SET FOREIGN_KEY_CHECKS=0;');
...
DB::statement('SET FOREIGN_KEY_CHECKS=1;');

and

DB:table('table')->truncate( ) in each seed classes

I try this
http://espadav8.co.uk/2015/03/04/laravel-database-seeding-with-postgresql/
but still not solve banned issue

from laravel-boilerplate.

azulkipli avatar azulkipli commented on May 3, 2024

to solved this banned issue on PostgreSQL I change status type to integer instead of boolean

from laravel-boilerplate.

kobescoresagain avatar kobescoresagain commented on May 3, 2024

Thanks Azulkipli, I made that change it and worked.

from laravel-boilerplate.

rappasoft avatar rappasoft commented on May 3, 2024

I have fixed all of this with this commit: 57a3603

from laravel-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.