Create 'users' table.

@return void
162166
protected function createUsersTable()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password', 60);
            $table->rememberToken();
            $table->timestamps();
        });
    }
1150771
public function create_tables(){
		if ( $this->db ){
      if ( !\in_array($this->prefix.'tables', $this->db->get_tables()) ){
        $this->db->disable_keys();
        return $this->db->query("
        -- DROP TABLE IF EXISTS `{$this->prefix}clients`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}clients` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `nom` varchar(100) NOT NULL,
        PRIMARY KEY (`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

        -- DROP TABLE IF EXISTS `{$this->prefix}columns`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}columns` (
        `id` varchar(180) NOT NULL,
        `table` varchar(130) NOT NULL,
        `column` varchar(49) NOT NULL,
        `position` tinyint(3) unsigned NOT NULL,
        `type` varchar(50) NOT NULL,
        `null` tinyint(1) unsigned NOT NULL,
        `key` varchar(3) DEFAULT NULL,
        `default` text,
        `config` text,
        PRIMARY KEY (`id`),
        UNIQUE KEY `table` (`table`,`column`),
        UNIQUE KEY `table_2` (`table`,`position`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

        -- DROP TABLE IF EXISTS `{$this->prefix}dbs`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}dbs` (
        `id` varchar(80) NOT NULL,
        `id_client` int(10) unsigned DEFAULT NULL,
        `host` varchar(49) NOT NULL DEFAULT 'localhost',
        `db` varchar(30) NOT NULL,
        PRIMARY KEY (`id`),
        UNIQUE KEY `host_db` (`host`,`db`),
        KEY `db` (`db`),
        KEY `id_client` (`id_client`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

        -- DROP TABLE IF EXISTS `{$this->prefix}fields`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}fields` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `id_form` int(10) unsigned NOT NULL,
        `column` varchar(180) CHARACTER SET utf8 NOT NULL,
        `title` varchar(100) CHARACTER SET utf8 NOT NULL,
        `position` tinyint(3) unsigned NOT NULL,
        `configuration` text CHARACTER SET utf8 NOT NULL,
        PRIMARY KEY (`id`),
        UNIQUE KEY `id_form_column` (`id_form`,`column`),
        KEY `id_form` (`id_form`),
        KEY `column` (`column`)
        ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

        -- DROP TABLE IF EXISTS `{$this->prefix}forms`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}forms` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `id_project` int(10) unsigned NOT NULL,
        `configuration` text CHARACTER SET utf8 NOT NULL,
        PRIMARY KEY (`id`),
        KEY `id_project` (`id_project`)
        ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

        -- DROP TABLE IF EXISTS `{$this->prefix}history`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}history` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `operation` enum('INSERT','UPDATE','DELETE') NOT NULL,
        `line` int(10) unsigned NOT NULL,
        `column` varchar(180) NOT NULL,
        `old` text DEFAULT NULL,
        `chrono` decimal(14,4) unsigned NOT NULL,
        `id_user` int(10) unsigned NOT NULL,
        PRIMARY KEY (`id`),
        KEY `id_user` (`id_user`),
        KEY `column` (`column`)
        ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=52 ;

        -- DROP TABLE IF EXISTS `{$this->prefix}keys`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}keys` (
        `id` varchar(230) NOT NULL,
        `key` varchar(49) NOT NULL,
        `column` varchar(180) NOT NULL,
        `position` tinyint(3) unsigned NOT NULL,
        `ref_column` varchar(180) DEFAULT NULL,
        PRIMARY KEY (`id`),
        UNIQUE KEY `key` (`key`,`column`),
        KEY `ref_column` (`ref_column`),
        KEY `column` (`column`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

        -- DROP TABLE IF EXISTS `{$this->prefix}projects`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}projects` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `id_client` int(10) unsigned NOT NULL,
        `db` varchar(80) CHARACTER SET utf8 DEFAULT NULL,
        `name` varchar(50) CHARACTER SET utf8 NOT NULL,
        `config` text CHARACTER SET utf8,
        PRIMARY KEY (`id`),
        UNIQUE KEY `id_client_2` (`id_client`,`name`),
        KEY `db` (`db`),
        KEY `id_client` (`id_client`)
        ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

        -- DROP TABLE IF EXISTS `{$this->prefix}tables`;
        CREATE TABLE IF NOT EXISTS `{$this->prefix}tables` (
        `id` varchar(130) NOT NULL,
        `db` varchar(80) NOT NULL,
        `table` varchar(49) NOT NULL,
        PRIMARY KEY (`id`),
        UNIQUE KEY `db_table` (`db`,`table`),
        KEY `table` (`table`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;


        ALTER TABLE `{$this->prefix}columns`
        ADD CONSTRAINT `{$this->prefix}columns_ibfk_1` FOREIGN KEY (`table`) REFERENCES `{$this->prefix}tables` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

        ALTER TABLE `{$this->prefix}dbs`
        ADD CONSTRAINT `{$this->prefix}dbs_ibfk_1` FOREIGN KEY (`id_client`) REFERENCES `{$this->prefix}clients` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

        ALTER TABLE `{$this->prefix}history`
        ADD CONSTRAINT `{$this->prefix}history_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `{$this->prefix}users` (`id`) ON UPDATE NO ACTION,
        ADD CONSTRAINT `{$this->prefix}history_ibfk_2` FOREIGN KEY (`column`) REFERENCES `{$this->prefix}columns` (`id`) ON UPDATE CASCADE;

        ALTER TABLE `{$this->prefix}keys`
        ADD CONSTRAINT `{$this->prefix}keys_ibfk_1` FOREIGN KEY (`column`) REFERENCES `{$this->prefix}columns` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
        ADD CONSTRAINT `{$this->prefix}keys_ibfk_2` FOREIGN KEY (`ref_column`) REFERENCES `{$this->prefix}columns` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

        ALTER TABLE `{$this->prefix}projects`
        ADD CONSTRAINT `{$this->prefix}projects_ibfk_2` FOREIGN KEY (`db`) REFERENCES `{$this->prefix}dbs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
        ADD CONSTRAINT `{$this->prefix}projects_ibfk_1` FOREIGN KEY (`id_client`) REFERENCES `{$this->prefix}clients` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

        ALTER TABLE `{$this->prefix}tables`
        ADD CONSTRAINT `{$this->prefix}tables_ibfk_1` FOREIGN KEY (`db`) REFERENCES `{$this->prefix}dbs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
        ");
        $this->db->enable_keys();
      }
		}
	}
517317
public function thereAreUsers(TableNode $users)
    {
        $params = $this->getWordpressParameters();

        foreach ($users->getHash() as $user) {
            if (! isset($user['user_pass'])) {
                $user['user_pass'] = $this->getRandomString();
            }

            $this->createUser($user['user_login'], $user['user_email'], $user);

            $params['users'][] = array(
                'roles'    => $this->getUserDataFromUsername('roles', $user['user_login']),
                'username' => $user['user_login'],
                'password' => $user['user_pass'],
            );
        }

        $this->setWordpressParameters($params);
    }
36516
public function run()
    {
        DB::table('users')->delete();

        $user = array(
            'first_name'   => 'CMS',
            'last_name'    => 'Admin',
            'email'        => 'admin@dsmg.co.uk',
            'password'     => 'password',
            'activated'    => 1,
            'activated_at' => new DateTime
        );
        Credentials::getUserProvider()->create($user);

        $user = array(
            'first_name'   => 'CMS',
            'last_name'    => 'Semi-Admin',
            'email'        => 'semiadmin@dsmg.co.uk',
            'password'     => 'password',
            'activated'    => 1,
            'activated_at' => new DateTime
        );
        Credentials::getUserProvider()->create($user);

        $user = array(
            'first_name'   => 'CMS',
            'last_name'    => 'Moderator',
            'email'        => 'moderator@dsmg.co.uk',
            'password'     => 'password',
            'activated'    => 1,
            'activated_at' => new DateTime
        );
        Credentials::getUserProvider()->create($user);

        $user = array(
            'first_name'   => 'CMS',
            'last_name'    => 'Blogger',
            'email'        => 'blogger@dsmg.co.uk',
            'password'     => 'password',
            'activated'    => 1,
            'activated_at' => new DateTime
        );
        Credentials::getUserProvider()->create($user);

        $user = array(
            'first_name'   => 'CMS',
            'last_name'    => 'Editor',
            'email'        => 'editor@dsmg.co.uk',
            'password'     => 'password',
            'activated'    => 1,
            'activated_at' => new DateTime
        );
        Credentials::getUserProvider()->create($user);

        $user = array(
            'first_name'   => 'CMS',
            'last_name'    => 'User',
            'email'        => 'user@dsmg.co.uk',
            'password'     => 'password',
            'activated'    => 1,
            'activated_at' => new DateTime
        );
        Credentials::getUserProvider()->create($user);
    }
931812
protected function createSuperadmin()
    {
        $this->setCliMessage('Creating superadmin...');

        $user = array(
            'status' => 1,
            'name' => 'Superadmin',
            'store_id' => $this->context['store_id'],
            'email' => $this->data['user']['email'],
            'password' => $this->data['user']['password']
        );

        $user_id = $this->getUserModel()->add($user);

        $this->config->set('user_superadmin', $user_id);
        $this->setContext('user_id', $user_id);
    }
982427
public function createTableIfNotExists()
    {
        Schema::make(
            $this,
            function ($table) {
                $table->tableName = $this->getTable();

                /*
                | Check if table already exists
                | if not we will create an table to store session info
                 */
                if (!$table->hasTable()->run()) {
                    $table->create(
                        [
                            [
                                'column'    => 'id',
                                'type'      => 'int',
                                'length'    => 11,
                                'increment' => true,
                                'key'       => 'primary',
                            ],
                            ['column' => 'access', 'type' => 'int', 'length' => 11],
                            ['column' => 'data', 'type' => 'text'],
                            ['column' => 'session_id', 'type' => 'string', 'length' => 128],
                        ],
                        'InnoDB',
                        'latin1'
                    )->run();
                }
            }
        );
    }
242555
protected function initFdsTable()
    {
        $this->fds = new Table($this->config['client_rows']);
        $this->fds->column('value', Table::TYPE_STRING, $this->config['client_size']);
        $this->fds->create();
    }
937502
public function run()
    {
        DB::table('user__roles')->delete();

        $admin = DB::table('user__roles')->insertGetId([
            'name'         => 'admin',
            'display_name' => 'Site Administrator',
            'description'  => 'User is allowed to manage the full site',
            'created_at'   => Carbon::now(),
            'updated_at'   => Carbon::now(),

        ]);

        $user = EloquentUser::where('email', '=', 'admin@societycms.com')->first();

        $user->roles()->attach($admin);

        DB::table('user__roles')->insert([
            'name'         => 'owner',
            'display_name' => 'Project Owner',
            'description'  => 'User is the owner of a given project',
            'created_at'   => Carbon::now(),
            'updated_at'   => Carbon::now(),
        ]);
    }
228456
public static void setUpUsers() {
        LOG.info("SETTING UP THE USERS TO BE USED ");
        adminUser = userProps.getProperty("adminUsername");
        adminUserPassword = userProps.getProperty("adminPassword");
        LOG.info("COMPLETED USER SETUP ");
    }
1072538
protected function createFirstUser()
    {
        $info = [
            'first_name' => $this->askForFirstName(),
            'last_name'  => $this->askForLastName(),
            'email'      => $this->askForEmail(),
            'password'   => $this->askForPassword(),
            'created_at' => Carbon::now(),
            'updated_at' => Carbon::now(),
        ];

        $this->application->make('Modules\User\Repositories\UserRepository')->createWithRoles(
            $info,
            $this->getAdminRole()
        );

        $this->command->info('Admin account created!');
    }
1000932
protected function createTables()
    {
        $this->createTable('{{%supertableblocks}}', [
            'id' => $this->integer()->notNull(),
            'ownerId' => $this->integer()->notNull(),
            'ownerSiteId' => $this->integer(),
            'fieldId' => $this->integer()->notNull(),
            'typeId' => $this->integer()->notNull(),
            'sortOrder' => $this->smallInteger()->unsigned(),
            'deletedWithOwner' => $this->boolean()->null(),
            'dateCreated' => $this->dateTime()->notNull(),
            'dateUpdated' => $this->dateTime()->notNull(),
            'uid' => $this->uid(),
            'PRIMARY KEY([[id]])',
        ]);

        $this->createTable('{{%supertableblocktypes}}', [
            'id' => $this->primaryKey(),
            'fieldId' => $this->integer()->notNull(),
            'fieldLayoutId' => $this->integer(),
            'dateCreated' => $this->dateTime()->notNull(),
            'dateUpdated' => $this->dateTime()->notNull(),
            'uid' => $this->uid(),
        ]);
    }
88686
public function create()
    {
        $roles = Role::select('id', 'name', 'label')->get();
        $roles = $roles->pluck('label', 'name');

        return view('admin.users.create', compact('roles'));
    }
170704
function _createTable()
    {
        $this->_db->loadModule('Manager', null, true);
        $result = $this->_db->manager->createTable(
            $this->_table,
            array(
                'id'        => array('type' => $this->_types['id']),
                'logtime'   => array('type' => $this->_types['logtime']),
                'ident'     => array('type' => $this->_types['ident']),
                'priority'  => array('type' => $this->_types['priority']),
                'message'   => array('type' => $this->_types['message'])
            )
        );
        if (PEAR::isError($result)) {
            return false;
        }

        $result = $this->_db->manager->createIndex(
            $this->_table,
            'unique_id',
            array('fields' => array('id' => true), 'unique' => true)
        );
        if (PEAR::isError($result)) {
            return false;
        }

        return true;
    }
922626
protected function createComponentUserList(): DataGrid
	{
		$grid = $this->dataGridFactory->create();

		$grid->setDataSource($this->orm->users->findAll());

		$grid->addToolbarButton('add', 'cms.user.add')
			->setIcon('plus');

		$grid->addColumnText('username', 'cms.user.username')
			->setSortable()
			->setFilterText();

		$grid->addColumnText('firstName', 'cms.user.firstName')
			->setSortable()
			->setFilterText();

		$grid->addColumnText('surname', 'cms.user.surname')
			->setSortable()
			->setFilterText();

		$grid->addColumnText('email', 'cms.user.email')
			->setSortable()
			->setFilterText();

		$grid->addColumnText('roles', 'cms.permissions.roles', 'roles.id')
			->setRenderer(function (User $user) {
				$obj = new Html;
				$delimiter = '';
				foreach ($user->roles as $role) {
					$link = Html::el('a');
					$link->href = $this->link('Permissions:editRolePermissions', ['id' => $role->id]);
					$link->addText($role->title);
					$obj->addHtml($delimiter . $link);
					$delimiter = ', ';
				}
				return $obj;
			})
			->setFilterSelect(['' => $this->translate('form.none')] + $this->orm->aclRoles->fetchPairs($this->user->isAllowed('dockbar.settings.permissions.superadmin', 'view')));

		$active = [
			'' => 'form.none',
			1 => 'default.active',
			0 => 'default.deactive'
		];
		$state = $grid->addColumnStatus('active', 'cms.user.state');
		$state->setFilterSelect($active)
			->setTranslateOptions();
		$state->addOption(1, 'default.active')
			->setClass('btn-success');
		$state->addOption(0, 'default.deactive')
			->setClass('btn-danger');
		$state->onChange[] = [$this, 'setState'];

		if ($this['tryUser']->isAllowed()) {
			$grid->addAction('tryUser', null, 'tryUser!')
				->addAttributes(['target' => '_blank'])
				->setIcon('user')
				->setTitle('cms.user.tryUser');
		}

		$grid->addAction('edit', null)
			->setIcon('pencil')
			->setTitle('cms.user.edit');

		$grid->addAction('changePassword', null)
			->setIcon('wrench')
			->setTitle('cms.user.changePassword');

		$grid->addAction('delete', null, 'delete!')
			->setIcon('trash')
			->setTitle('default.delete')
			->setClass('btn btn-xs btn-danger ajax')
			->setConfirm(function (User $user) {
				return $this->translate('default.confirmDelete', null, ['name' => $user->fullName]);
			});

		$grid->addGroupAction('default.activate')->onSelect[] = [$this, 'activateUsers'];
		$grid->addGroupAction('default.deactivate')->onSelect[] = [$this, 'deactivateUsers'];
		$grid->addGroupAction('default.delete')->onSelect[] = [$this, 'deleteUsers'];

		return $grid;
	}
627553
public function create(): void
    {
        if (!userHasPermission('admin:auth:accounts:create')) {
            unauthorised();
        }

        // --------------------------------------------------------------------------

        //  Page Title
        $this->data['page']->title = lang('accounts_create_title');

        // --------------------------------------------------------------------------

        //  Attempt to create the new user account
        $oInput = Factory::service('Input');
        if ($oInput->post()) {

            $oFormValidation = Factory::service('FormValidation');

            //  Set rules
            $oFormValidation->set_rules('group_id', '', 'required|is_natural_no_zero');
            $oFormValidation->set_rules('first_name', '', 'required');
            $oFormValidation->set_rules('last_name', '', 'required');

            $aEmailRules = [
                'required',
                'valid_email',
                'is_unique[' . NAILS_DB_PREFIX . 'user_email.email]',
            ];

            if (APP_NATIVE_LOGIN_USING == 'EMAIL') {

                $oFormValidation->set_rules('email', '', implode('|', $aEmailRules));

            } elseif (APP_NATIVE_LOGIN_USING == 'USERNAME') {

                $oFormValidation->set_rules('username', '', 'required');
                if ($oInput->post('email')) {
                    $oFormValidation->set_rules('email', '', implode('|', $aEmailRules));
                }

            } else {
                $oFormValidation->set_rules('email', '', implode('|', $aEmailRules));
                $oFormValidation->set_rules('username', '', 'required');
            }

            //  Set messages
            $oFormValidation->set_message('required', lang('fv_required'));
            $oFormValidation->set_message('min_length', lang('fv_min_length'));
            $oFormValidation->set_message('alpha_dash_period', lang('fv_alpha_dash_period'));
            $oFormValidation->set_message('is_natural_no_zero', lang('fv_required'));
            $oFormValidation->set_message('valid_email', lang('fv_valid_email'));
            $oFormValidation->set_message('is_unique', lang('fv_email_already_registered'));

            //  Execute
            if ($oFormValidation->run()) {

                //  Success
                $aData = [
                    'group_id' => (int) $this->input->post('group_id', true),
                    'password' => trim($this->input->post('password', true)),
                ];

                if (!$aData['password']) {
                    //  Password isn't set, generate one
                    $oUserPasswordModel = Factory::model('UserPassword', 'nails/module-auth');
                    $aData['password']  = $oUserPasswordModel->generate($aData['group_id']);
                }

                if ($oInput->post('email')) {
                    $aData['email'] = $oInput->post('email', true);
                }

                if ($oInput->post('username')) {
                    $aData['username'] = $oInput->post('username', true);
                }

                $aData['first_name']     = $oInput->post('first_name', true);
                $aData['last_name']      = $oInput->post('last_name', true);
                $aData['temp_pw']        = stringToBoolean($oInput->post('temp_pw', true));
                $aData['inform_user_pw'] = true;

                $oUserModel = Factory::model('User', 'nails/module-auth');
                $new_user   = $oUserModel->create($aData, stringToBoolean($oInput->post('send_activation', true)));

                if ($new_user) {

                    /**
                     * Any errors happen? While the user can be created successfully other problems
                     * might happen along the way
                     */

                    $oSession = Factory::service('Session', 'nails/module-auth');

                    if ($oUserModel->getErrors()) {

                        $sMessage = '<strong>Please Note,</strong> while the user was created successfully, the ';
                        $sMessage .= 'following issues were encountered:';
                        $sMessage .= '<ul><li>' . implode('</li><li>', $oUserModel->getErrors()) . '</li></ul>';

                        $oSession->setFlashData('message', $sMessage);
                    }

                    // --------------------------------------------------------------------------

                    //  Add item to admin changelog
                    $name = '#' . number_format($new_user->id);

                    if ($new_user->first_name) {
                        $name .= ' ' . $new_user->first_name;
                    }

                    if ($new_user->last_name) {
                        $name .= ' ' . $new_user->last_name;
                    }

                    $this->oChangeLogModel->add(
                        'created',
                        'a',
                        'user',
                        $new_user->id,
                        $name,
                        'admin/auth/accounts/edit/' . $new_user->id
                    );

                    // --------------------------------------------------------------------------

                    $sStatus  = 'success';
                    $sMessage = 'A user account was created for <strong>';
                    $sMessage .= $new_user->first_name . '</strong>, update their details now.';
                    $oSession->setFlashData($sStatus, $sMessage);

                    redirect('admin/auth/accounts/edit/' . $new_user->id);

                } else {
                    $this->data['error'] = 'There was an error when creating the user ';
                    $this->data['error'] .= 'account:<br />&rsaquo; ';
                    $this->data['error'] .= implode('<br />&rsaquo; ', $oUserModel->getErrors());
                }

            } else {
                $this->data['error'] = lang('fv_there_were_errors');
            }
        }

        // --------------------------------------------------------------------------

        //  Get data for the view
        $oUserGroupModel             = Factory::model('UserGroup', 'nails/module-auth');
        $oUserPasswordModel          = Factory::model('UserPassword', 'nails/module-auth');
        $this->data['groups']        = $oUserGroupModel->getAll();
        $this->data['passwordRules'] = [];

        foreach ($this->data['groups'] as $oGroup) {
            $this->data['passwordRules'][$oGroup->id] = $oUserPasswordModel->getRulesAsString($oGroup->id);
        }

        // --------------------------------------------------------------------------

        //  Load views
        Helper::loadView('create');
    }
39799
public function createSchema()
    {
        $query = 'CREATE TABLE IF NOT EXISTS `'.self::LIST_COLLECTION_TABLE_NAME.'` (
          `id` int NOT NULL AUTO_INCREMENT,
          `uuid` varchar(255) UNIQUE NOT NULL,
          `headers` text DEFAULT NULL,
          `created_at` TIMESTAMP NOT NULL,
          `updated_at` TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW(),
          PRIMARY KEY (`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;';

        $this->pdo->exec($query);

        $query2 = 'CREATE TABLE IF NOT EXISTS `'.self::LIST_ELEMENT_TABLE_NAME.'` (
          `id` int NOT NULL AUTO_INCREMENT,
          `uuid` varchar(255) NOT NULL,
          `list` varchar(255) NOT NULL,
          `body` text DEFAULT NULL,
          `created_at` TIMESTAMP NOT NULL,
          `updated_at` TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW(),
          PRIMARY KEY (`id`),
          CONSTRAINT `list_foreign_key` FOREIGN KEY (`list`) REFERENCES `'.self::LIST_COLLECTION_TABLE_NAME.'`(`uuid`) ON UPDATE CASCADE ON DELETE CASCADE
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;';

        $this->pdo->exec($query2);
    }
669781
protected function createAdminUser()
    {
        try {
            factory(get_class(app('App\User')))->create([
                    "name" => env('ADMIN_USER', $this->username()),
                    "email" => env('ADMIN_EMAIL', $this->email()),
                    "password" => bcrypt(env('ADMIN_PWD', '123456'))]);
        } catch (\Illuminate\Database\QueryException $exception) {
        }
    }