Run the database seeds.

@return void
425562
public function run(): void
    {
        $continents = json_decode(file_get_contents(__DIR__ . '/../../resources/json/continents.json'), true);

        foreach ($continents as $continent) {

            $this->connection->beginTransaction();

            try {
                $translations = $continent['translations'];
                array_forget($continent, 'translations');

                $continentRecord = $this->continentRepository->updateOrCreate(['id' => $continent['id']], $continent);
                $continentRecord->updateTranslations($translations);

                $this->connection->commit();

            } catch (\Exception $e) {
                $this->connection->rollBack();
                dd($e);
            }
        }
    }
1296915
public function run()
    {

        // Check if we have the schedules, else,
        // insert them
        foreach ($this->schedule as $job) {

            if (! DB::table('schedules')->where('command', $job['command'])->first())
                DB::table('schedules')->insert($job);
        }
    }
451321
public function run()
    {
        $groups = $this->groups ?: $this->groups();
        DB::table('group_permissions')->truncate();

        foreach ($groups as $group) {
            $permissions = $group['permissions'] ?? [];
            unset($group['permissions']);

            /** @var Group $groupModel */
            $groupModel = Group::firstOrCreate($group);

            foreach ($permissions as $permission) {
                $groupModel->grantPermissions(Permission::firstOrCreate($permission));
            }
        }
    }
80371
public function run()
    {
        config()->set('gzero-core.db_transactions', false);
        $languages = Language::all()->keyBy('code');
        $users     = $this->seedUsers();
        $contents  = $this->seedContent($languages, $users);
        $this->seedBlock(BlockType::all(), $languages, $users, $contents);
        //$fileTypes    = $this->seedFileTypes();
        //$files        = $this->seedFiles($fileTypes, $languages, $users, $contents, $blocks);
        //$this->seedOptions($languages);
    }
1374035
public function run()
    {
        foreach (['super', 'admin', 'banned', 'author', 'registered'] as $role) {
            if (DB::table('roles')->where(compact('role'))->first()) {
                continue;
            }

            DB::table('roles')->insert(compact('role'));
        }
    }
905358
public function run()
    {
        if (User::count() == 0) {
            $role = Role::where('name', 'admin')->firstOrFail();

            User::create([
                'name'           => 'Admin',
                'email'          => 'admin@admin.com',
                'password'       => bcrypt('password'),
                'remember_token' => str_random(60),
                'role_id'        => $role->id,
            ]);
        }
    }
768166
public function run()
    {
        $this->seed([
            [
                'group'       => [
                    'name'        => 'Blog',
                    'slug'        => 'blog',
                    'description' => 'Blog permissions group',
                ],
                'permissions' => array_merge(
                    $this->getDashboardPermissions(),
                    $this->getPostsPermissions(),
                    $this->getCategoriesPermissions(),
                    $this->getTagsPermissions()
                ),
            ],
        ]);
    }
391885
public function run()
    {
        $this->seed([
            [
                'group'       => [
                    'name'        => 'SEO',
                    'slug'        => 'seo',
                    'description' => 'SEO permissions group',
                ],
                'permissions' => array_merge(
                    $this->getDashboardSeeds(),
                    $this->getPagesSeeds(),
                    $this->getFootersSeeds(),
                    $this->getMetasSeeds(),
                    $this->getRedirectsSeeds()
                ),
            ],
        ]);
    }
191210
public function run()
    {
        $MenuTypes = ['header', 'sidebar', 'footer'];

        foreach ($MenuTypes as $MenuType) {
            $Type = ['type' => $MenuType];

            factory(Menu::class, 5)->create($Type)->each(function ($u) use ($Type) {
                $u->children()->saveMany(factory(Menu::class, 2)->create($Type)
                    ->each(function ($p) use ($Type) {
                        $p->children()->saveMany(factory(Menu::class, 2)->make($Type));
                    }));
            });
        }
    }
557148
public function run()
    {
        $this->languages = ['ru', 'en'];

        foreach ($this->languages as $language) {
            Language::create(
                $this->languages()[$language]
            );
        }
    }
1132141
public function run()
    {
        $this->call(UsersTableSeeder::class);
        $this->call(EmailsTableSeeder::class);
        $this->call(FormsTableSeeder::class);
    }
1209889
public function run(): void
    {
        // http://stackoverflow.com/q/1598411
        $list = [
            ['name' => 'Super Admin', 'slug' => HCRoleRepository::ROLE_SA], // Manage everything
            ['name' => 'Project Admin', 'slug' => HCRoleRepository::ROLE_PA], // Manage most aspects of the site
            ['name' => 'User', 'slug' => HCRoleRepository::ROLE_U], // Average Joe
        ];

        foreach ($list as $roleData) {
            $role = $this->repository->findOneBy(['slug' => $roleData['slug']]);

            if (!$role) {
                $this->repository->create($roleData);
            }
        }
    }
336518
public function run() {
		$options    = $this->get_class_vars( 'Base', 'options' );
		$db_version = isset( $options['db_version'] ) ? (int) $options['db_version'] : 6000;

		if ( $db_version === $this->db_version ) {
			return;
		}

		switch ( $db_version ) {
			case $db_version < $this->db_version:
				$this->delete_flush_cache();
				break;
			default:
				break;
		}

		$options = array_merge( (array) $options, [ 'db_version' => (int) $this->db_version ] );
		update_site_option( 'github_updater', $options );
	}
565182
public function run()
    {
        $argument        = Eurekon\Argument::getInstance();
        $directory       = (string) $argument->get('directory');
        $configName      = (string) $argument->get('item');
        $configNamespace = (string) $argument->get('namespace', null, 'global.database');
        $dbName          = (string) $argument->get('db');

        //~ Init db connection
        $container  = Container::getInstance();
        $config  = $container->get('config');
        Database::getInstance()->setConfig($config->get($configNamespace));

        $directory = realpath(trim(rtrim($directory, '\\')));
        $file      = $directory . DIRECTORY_SEPARATOR . 'orm.yml';

        if (!is_readable($file)) {
            throw new \LogicException('Configuration file for ORM not available!');
        }

        $yaml = new Yaml();
        $data = $yaml->load($file);

        $directory = $directory . DIRECTORY_SEPARATOR . $data['orm']['directory'];
        $namespace = $data['orm']['namespace'];

        if (!is_dir($directory) && !mkdir($directory, 0764, true)) {
            throw new \RuntimeException('Cannot created output directory! (dir:' . $directory . ')');
        }

        $configs = $this->findConfigs($file, $data, $configName, true);

        $builder = new Builder();
        $builder->setDatabase(Database::get($dbName));
        $builder->setNamespace($namespace);
        $builder->setDirectory($directory);
        $builder->build($configs);
    }
656953
public function run()
    {
        $this->_scanner->stdout('Detect DatabaseTable - BEGIN', Console::FG_GREY);
        if (is_array($this->_tables)) {
            foreach ($this->_tables as $tables) {
                $this->_scanningTable($tables);
            }
        }

        $this->_scanner->stdout('Detect DatabaseTable - END', Console::FG_GREY);
    }
1248868
public function run()
    {
        $this->Script->startup();

        $this->Options = $this->Script->getOptions(
            "[db-host:][db-user:][db-password:][db-database:][db-type:|db-driver:][sql][clean][clean-all][conc:][php-exec:][commit-within:]",
            "",
            array(
                'db-host' => "Database host",
                'db-user' => "Database user",
                'db-password' => "Database password",
                'db-database' => "Database name",
                'db-driver' => "Database driver",
                'db-type' => "Database driver, alias for --db-driver",
                'sql' => "Display sql queries",
                'clean' =>  "Remove all search data of the current installation id before beginning indexing",
                'clean-all' => "Remove all search data for all installations",
                'conc' => 'Parallelization, number of concurent processes to use',
                'php-exec' => 'Full path to PHP executable',
                'commit-within' => 'Commit to Solr within this time in seconds (default '
                    . self::DEFAULT_COMMIT_WITHIN . ' seconds)',
            )
        );
        $this->Script->initialize();

        // check if ezfind is enabled and exit if not
        if ( ! in_array( 'ezfind', eZExtension::activeExtensions() ) )
        {
            $this->CLI->error( 'eZ Find extension is not enabled and because of that index process will fail. Please enable it and run this script again.' );
            $this->Script->shutdown( 0 );
        }

        // Fix siteaccess
        $siteAccess = $this->Options['siteaccess'] ? $this->Options['siteaccess'] : false;
        if ( $siteAccess )
        {
            $this->changeSiteAccessSetting( $siteAccess );
        }
        else
        {
            $this->CLI->warning( 'You did not specify a siteaccess. The admin siteaccess is a required option in most cases.' );
            $input = readline( 'Are you sure the default siteaccess has all available languages defined? ([y] or [q] to quit )' );
            if ( $input === 'q' )
            {
                $this->Script->shutdown( 0 );
            }
        }

        // Check that Solr server is up and running
        if ( !$this->checkSolrRunning() )
        {
            $this->Script->shutdown( 1 );
            exit();
        }

        $this->initializeDB();

        // call clean up routines which will deal with the CLI arguments themselves
        $this->cleanUp();
        $this->cleanUpAll();

        if ( isset( $this->Options['commit-within'] )
                && is_numeric( $this->Options['commit-within'] ) )
        {
            $this->commitWithin = (int)$this->Options['commit-within'];
        }


        $this->CLI->output( 'Starting object re-indexing' );

        // Get PHP executable from user.
        $this->getPHPExecutable();

        $this->runMain();
    }
696670
public function run()
    {
        $this->seed('DataTypesTableSeeder');
        $this->seed('DataRowsTableSeeder');
        $this->seed('MenusTableSeeder');
        $this->seed('MenuItemsTableSeeder');
        $this->seed('RolesTableSeeder');
        $this->seed('PermissionsTableSeeder');
        $this->seed('PermissionRoleTableSeeder');
        //测试数据
        $this->seed('CategoriesTableSeeder');
        $this->seed('UsersTableSeeder');
        $this->seed('PostsTableSeeder');
        $this->seed('PagesTableSeeder');
        $this->seed('SettingsTableSeeder');
        $this->seed('TranslationsTableSeeder');
    }