Create the migration.

@return bool
962109
protected function createMigration()
    {
        $migrationFile = base_path("/database/migrations") . "/" . date('Y_m_d_His')
            . "_create_settings_table.php";

        $output = $this->laravel->view->make('settings::generators.migration')->render();

        if (!file_exists($migrationFile) && $fs = fopen($migrationFile, 'x')) {
            fwrite($fs, $output);
            fclose($fs);

            return true;
        }

        return false;
    }
868907
public function up()
    {
        Schema::create(
            'users',
            function (Blueprint $table) {
                $table->increments('id');
                $table->string('email')->unique();
                $table->string('password');
                $table->string('name')->unique()->nullable();
                $table->string('first_name')->nullable();
                $table->string('last_name')->nullable();
                $table->boolean('is_admin')->default(false);
                $table->rememberToken();
                $table->timestamps();
            }
        );

        // Seed users
        $this->seedUsers();
    }
1031140
public function migrateUp()
    {
        Schema::create('tddd_runs', function (Blueprint $table) {
            $table->increments('id');

            $table->integer('test_id')->unsigned();

            $table->boolean('was_ok');

            $table->mediumText('log');

            $table->text('html')->nullable();

            $table->text('png')->nullable();

            $table->timestamps();
        });

        Schema::table('tddd_runs', function (Blueprint $table) {
            $table->foreign('test_id')
                ->references('id')
                ->on('tddd_tests')
                ->onDelete('cascade')
                ->onUpdate('cascade');
        });
    }
126390
public function up()
    {
        //======
        // USERS
        //======
        // Either uncomment the section below to create the users table if it
        // was not already done before, or use it as an example for your own
        // migration.
//        // Create users table
//        Schema::create('users', function (Blueprint $table) {
//            $table->increments('id');
//            $table->string('first_name');
//            $table->string('last_name');
//            $table->string('username')->unique();
//            $table->string('email')->unique();
//            $table->string('password', 60);
//            $table->rememberToken();
//            $table->timestamps();
//        });

        // USERS: Add the auth_type column.
        Schema::table('users', function (Blueprint $table) {
            $table->string('auth_type')->nullable();
        });

        //=======
        // GROUPS
        //=======
        // Either uncomment the section below to create the groups table if it
        // was not already done before, or use it as an example for your own
        // migration.
//        // Create table for storing groups
//        Schema::create('groups', function (Blueprint $table) {
//            $table->increments('id');
//            $table->string('name')->unique();
//            $table->string('display_name')->nullable();
//            $table->string('description')->nullable();
//            $table->timestamps();
//        });
//
//        // Create table for associating groups to users (Many-to-Many)
//        Schema::create('group_user', function (Blueprint $table) {
//            $table->integer('user_id')->unsigned();
//            $table->integer('group_id')->unsigned();
//
//            $table->foreign('user_id')->references('id')->on('users')
//                ->onUpdate('cascade')->onDelete('cascade');
//            $table->foreign('group_id')->references('id')->on('groups')
//                ->onUpdate('cascade')->onDelete('cascade');
//
//            $table->primary(['user_id', 'group_id']);
//        });

        // GROUPS: Add the resync_on_login column.
        Schema::table('groups', function (Blueprint $table) {
            $table->boolean('resync_on_login')->default(false);
        });


    }
748754
public function makeMigration()
    {
        $tableName = $this->ask('Table Name (Example: users)');

        if ($this->confirm('Are you creating a new table')) {
            $this->info('Setting create option for table '. $tableName);

            $this->options['--create'] = $tableName;
            $this->options['name'] = 'create_'. $tableName .'_table';
        } else {
            $this->info('Setting table option for table '. $tableName);

            $this->options['--table'] = $this->options['name'];
            $this->options['name'] = $this->ask('Migration Name (Example: alter_user_table_add_column_is_admin)', 'alter_'. $tableName .'_table_'. rand(0, 100));
        }

        if (! $this->confirm('Use default migration folder?', 'yes')) {
            $this->options['path'] = $this->ask('Path for Migration');
        }
    }
945587
public function migrate()
	{
		$table = 'fe_users';
		$column = 'siteid';

		$this->msg( sprintf( 'Adding "%1$s" column to "%2$s" table', $column, $table ), 0 );

		$schema = $this->getSchema( 'db-customer' );

		if( isset( $this->migrate[$schema->getName()] )
			&& $schema->tableExists( $table ) === true
			&& $schema->columnExists( $table, $column ) === false )
		{
			foreach ( $this->migrate[$schema->getName()] as $stmt )
			{
				$this->execute( $stmt );
			}
			$this->status( 'done' );
		}
		else
		{
			$this->status( 'OK' );
		}
	}
104388
public function up()
    {
        if (!Schema::hasTable('users'))
        {
            Schema::create('users', function (Blueprint $table)
            {
                $table->engine = 'InnoDB';

                $table->increments('id')->unsigned();

                $table->string('name');
                $table->string('email')->unique();
                $table->string('password', 60);
                $table->rememberToken();
                $table->boolean('activated')->default(true);

                $table->dateTime('last_login')->nullable();
                $table->string('last_login_ip')->nullable();

                $table->boolean('enabled')->default(true);

                // Two-Factor Authentication Columns
                $table->boolean('two_factor_auth_enabled')->default(false);
                $table->string('phone_country_code')->nullable();
                $table->string('phone_number')->nullable();
                $table->string('sms_token')->nullable();
                $table->timestamp('sms_token_created_at')->nullable();

                // Token Based Login Authentication Columns ==> NEW PACKAGE FOR THIS!
                // https://github.com/lasallecms/lasallecms-l5-tokenbasedlogin-pkg
               // $table->string('login_token')->nullable();
               // $table->timestamp('login_token_created_at')->nullable();

                $table->timestamp('created_at');
                $table->integer('created_by')->unsigned()->default(0);

                $table->timestamp('updated_at');
                $table->integer('updated_by')->unsigned()->default(0);


                $table->timestamp('locked_at')->nullable();
                $table->integer('locked_by')->nullable();
            });
        }


        if (!Schema::hasTable('password_resets'))
        {
            Schema::create('password_resets', function (Blueprint $table)
            {
                $table->string('email')->index();
                $table->string('token')->index();
                $table->timestamp('created_at');
            });
        }


        if (!Schema::hasTable('groups'))
        {
            Schema::create('groups', function (Blueprint $table)
            {
                $table->engine = 'InnoDB';

                $table->increments('id')->unsigned();

                $table->string('title')->unique();
                $table->string('description');


                $table->boolean('enabled')->default(true);

                $table->timestamp('created_at');
                $table->integer('created_by')->unsigned();
                $table->foreign('created_by')->references('id')->on('users');

                $table->timestamp('updated_at');
                $table->integer('updated_by')->unsigned();
                $table->foreign('updated_by')->references('id')->on('users');

                $table->timestamp('locked_at')->nullable();
                $table->integer('locked_by')->nullable()->unsigned();
                $table->foreign('locked_by')->references('id')->on('users');
            });
        }


        if (!Schema::hasTable('user_group'))
        {
            Schema::create('user_group', function (Blueprint $table)
            {
                $table->engine = 'InnoDB';

                $table->increments('id')->unsigned();

                $table->integer('user_id')->unsigned()->index();
                $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
                $table->integer('group_id')->unsigned()->index();
                $table->foreign('group_id')->references('id')->on('groups')->onDelete('cascade');
            });
        }
    }
1141804
protected function createMigration()
    {
        // migrations目录应该是根目录 app->path => base_pash
      $migration_file = base_path()."/database/migrations/".date('Y_m_d_His')."_workflow_setup_tables.php";
      $app = app();
      $resource_type = '';
      if(is_array($app['config']->get('resource_type'))){
        $resource_type = implode(",", app()['config']->get('workflow::resource_type'));
      }

      $output = $app['view']->make('workflow::generators.migration')->with('res_type',$resource_type)->render();

      if( ! file_exists( $migration_file ) )
      {
        $fs = fopen($migration_file, 'x');
        if ( $fs )
        {
          fwrite($fs, $output);
          fclose($fs);
          return true;
        }
        else
        {
          return false;
        }
      }
      else
      {
        return false;
      }
    }
27868
private function createIfNotExists()
    {
        $table = new Table('schema_migration');
        if ($this->info->isTableExists($table)) {
            return;
        }
        $primaryKey = new PrimaryKey(array('version'));
        $primaryKey->disableAutoIncrement();

        $table->addConstraint($primaryKey);
        $table
            ->addColumn(new BigIntegerColumn('version'))
            ->addColumn(new DateTimeColumn('created_at', array('nullable' => false, 'default' => 'now()')));
        $this->manipulation->create($table);
    }
267889
public function create()
    {
        $dir = $this->Folder->pwd();

        if (is_dir($dir) && is_writable($dir) && !$this->exists() && touch($this->path)) {
            return true;
        }

        return false;
    }
471106
public function create()
	{
		$db =  \App::get('db');

		if (empty($db))
		{
			return false;
		}

		// @FIXME: this should fail if id doesn't exist in #__users
		if ($this->user_id > 0)
		{
			$query = "INSERT INTO #__users_password (user_id) VALUES ( " . $db->quote($this->user_id) . ");";

			$db->setQuery($query);

			$result = $db->query();

			if ($result !== false || $db->getErrorNum() == 1062)
			{
				return true;
			}

			$this->update();
		}

		return false;
	}
1049759
public function up()
    {

        Schema::create('users', function (Blueprint $table) {

            $table->bigInteger('id')->primary();
            $table->integer('group_id');
            $table->string('name')->unique();
            $table->string('email')->unique()->nullable();
            $table->boolean('active')->default(true);
            $table->string('character_owner_hash');
            $table->dateTime('last_login')->nullable();
            $table->string('last_login_source')->nullable();
            $table->rememberToken();

            $table->index('group_id');

            $table->timestamps();
        });
    }
983388
protected function createMigration()
    {
        $table = Str::plural(Str::snake(class_basename($this->argument('name'))));

        $this->call('make:migration', [
            'name' => "create_{$table}_table",
            '--create' => $table,
        ]);
    }
1324447
protected function createMigration()
    {
        $migration_file = database_path('migrations').'/'.date('Y_m_d_His').'_create_ratings_table.php';

        if (! file_exists($migration_file) && $fs = fopen($migration_file, 'x')) {
            fwrite($fs, file_get_contents(__DIR__.'/../migrations/create_ratings_table.php'));
            fclose($fs);
            return true;
        }

        return false;
    }
1296622
public function create() {
        $migration = $this->getMessages();
        if (!$migration) {
            $this->db()->insert($this->table, array('migration' => get_class($this), 'state' => false));
        } else {
            throw new \Exception('Migration ' .  get_class($this) . ' already created');
        }
    }
608976
public function actionCreate()
    {
        $stdout = '';
        foreach ($this->db->schema->getTableSchemas() as $table) {
            if ($table->name === $this->migrationTable) {
                continue;
            }
            $stdout .= static::generateCreateTable($table->name).
                static::generateColumns($table->columns, $this->db->schema->findUniqueIndexes($table)).
                static::generatePrimaryKey($table->primaryKey, $table->columns).
                static::generateTableOptions();
        }
        foreach ($this->db->schema->getTableSchemas() as $table) {
            $stdout .= $this->generateForeignKey($table);
        }
        $this->stdout($stdout);
    }
978269
public static function create()
	{
		if ( file_exists( self::$authFile ) ) return false;
		if ( @touch( self::$authFile ) === false ) return false;

		self::$auth = array(
			'generated' => date('U'),
			'security'  => self::generateSecurityToken(),
			'anonymous' => array(),
			'users'     => array(),
		);

		self::save();

		return true;
	}