Changeset 4b7e2d3 for database/seeders


Ignore:
Timestamp:
10/23/21 04:03:46 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
b39afb5
Parents:
c6b84df
Message:

bug fixes, edited export, added fileSeeder for DB testing

Location:
database/seeders
Files:
1 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • database/seeders/DatabaseSeeder.php

    rc6b84df r4b7e2d3  
    1919        $this->call(UsersTableSeeder::class);
    2020        $this->call(DepartmentsTableSeeder::class);
    21         $this->call(FileTypeSeeder::class);
     21        $this->call(FileTypesTableSeeder::class);
    2222        $this->call(FoldersTableSeeder::class);
     23        $this->call(FilesTableSeeder::class);
    2324    }
    2425}
  • database/seeders/DepartmentsTableSeeder.php

    rc6b84df r4b7e2d3  
    44
    55use App\Models\Department;
     6use App\Models\Folder;
     7use App\Models\User;
    68use Carbon\Carbon;
    79use Illuminate\Database\Seeder;
  • database/seeders/FileTypesTableSeeder.php

    rc6b84df r4b7e2d3  
    66use Illuminate\Database\Seeder;
    77
    8 class FileTypeSeeder extends Seeder
     8class FileTypesTableSeeder extends Seeder
    99{
    1010    /**
     
    1616    {
    1717        \DB::table("file_types")->insert([
    18             "mimes" => "mimes:jpg,jpeg,png,pdf,docx,xls,xlsx,txt,ppt,pptx",
     18            "mimes" => "jpg,jpeg,png,pdf,docx,xls,xlsx,txt,ppt,pptx",
    1919            "max_size" => "5000",
    2020            "user_id" => "1",
  • database/seeders/FoldersTableSeeder.php

    rc6b84df r4b7e2d3  
    33namespace Database\Seeders;
    44
     5use App\Models\Department;
    56use App\Models\Folder;
    67use Carbon\Carbon;
     
    1617    public function run()
    1718    {
    18         Folder::factory()->count(300)->create();
     19        Folder::factory()->count(500)->create();
     20        $folders = Folder::all();
     21
     22        foreach ($folders as $folder) {
     23            $folder->department()->increment('no_of_folders');
     24        }
    1925    }
    2026}
  • database/seeders/UsersTableSeeder.php

    rc6b84df r4b7e2d3  
    2727            "is_confirmed" => true,
    2828            "created_by" => "1",
    29             "created_at" => Carbon::now()
     29            "created_at" => now()
    3030        ]);
    3131
    32         User::factory()->count(20)->create();
     32        User::factory()->count(50)->create();
    3333
    3434    }
Note: See TracChangeset for help on using the changeset viewer.