LaravelDaily / Laravel-AdminLTE3-Boilerplate

Boilerplate adminpanel: Laravel 6.0 + AdminLTE 3 (Bootstrap 4) and simple CRUD examples. Based on new QuickAdminPanel 2019.
https://2019.quickadminpanel.com
118 stars 57 forks source link

Extra lines of code needed if using SQL Server #22

Open eina84 opened 3 years ago

eina84 commented 3 years ago

If using SQL Server instead of mysql, the Permissions, Roles & Users table seeders will fail. If you add a line before & after the insert commands then it will work. e.g.

        DB::unprepared('SET IDENTITY_INSERT users ON');
        User::insert($users);
        DB::unprepared('SET IDENTITY_INSERT users OFF');

(If you don't do this until after running the seeder you might have to clear the tables out otherwise you will get a different error when you try to add the same user a 2nd time)