Changeset e78295c for database


Ignore:
Timestamp:
10/31/21 21:28:46 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
master
Children:
4521f25
Parents:
a55bb54
Message:

added version

Location:
database
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • database/factories/FolderFactory.php

    ra55bb54 re78295c  
    2727    public function definition()
    2828    {
    29         //$inputArray = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95];
    30         //$deptId = Arr::random($inputArray);
     29        $inputArray = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95];
     30        $deptId = Arr::random($inputArray);
    3131
    32         $deptId = $this->faker->numberBetween(1, 10);
     32        //$deptId = $this->faker->numberBetween(1, 10);
    3333
    3434        $deptCode = Department::find($deptId)->code;
     
    4646            'user_id' => 1,
    4747            'department_id' => $deptId,
    48             'is_important' => $this->faker->boolean,
     48            'version' => 1,
    4949            'created_at' => now()
    5050        ];
  • database/migrations/2021_10_06_103305_create_folders_table.php

    ra55bb54 re78295c  
    1616        Schema::create('folders', function (Blueprint $table) {
    1717            $table->bigIncrements('id')->startingValue(1);
    18             $table->string("arch_id")->unique();
     18            $table->string("arch_id");
    1919            $table->string("name");
    2020            $table->text("note")->nullable();
     
    2323            $table->integer("user_id")->unsigned();
    2424            $table->integer("department_id")->unsigned();
    25             $table->boolean("is_important")->default(false);
     25            $table->integer("version")->default(1);
    2626            $table->timestamps();
    2727
  • database/seeders/FoldersTableSeeder.php

    ra55bb54 re78295c  
    1717    public function run()
    1818    {
    19         Folder::factory()->count(900)->create();
     19        Folder::factory()->count(15)->create();
    2020        $folders = Folder::all();
    2121
Note: See TracChangeset for help on using the changeset viewer.