Create the migration.

@param string $name

@return bool
503705
protected function createMigration()
    {
        $files = scandir(__DIR__ . '/migrations');
        foreach ($files as $file) {
            if ($file == '.' || $file == '..' || file_exists(base_path('/database/migrations') . '/' . $file)) {
                continue;
            }
            if (copy(__DIR__ . '/migrations/' . $file, base_path('/database/migrations') . '/' . $file)) {
                $this->line("<info>Created Migration:</info> $file");
            }
        }
    }
583955
public function createBlankMigrationClassFile($name, $server_type = 'master', $migration_path = null)
    {
        $migrationCreator = new MigrationsCreator($this->userInteractionHandler);

        if (empty($migration_path)) {
            $migration_path = $this->getMigrationPath();
        }

        $success = $migrationCreator
            ->setPathTimeStamp($this->getSeedsDir())
            ->setVerbose($this->getVerbose())
            ->setName($name)
            ->setDescription('')
            ->setServerType($server_type)
            ->setMigrationsPath($migration_path)
            ->createBlankMigrationClassFile();

        $this->logCreatedMigration($migrationCreator->getLogData());
        return $success;
    }
348645
public static function create($name) {
    if (is_string($name)) {
      $name = NameNode::create($name);
    }
    /** @var ConstantNode $node */
    $node = new static();
    $node->addChild($name, 'constantName');
    return $node;
  }
170600
public function create($name)
    {
        $config = $this->getConfiguration($name);

        if(null === $config) {
            throw new \RuntimeException(
                "Connection with name: $name not found."
            );
        }

        return new Client($config);
    }
811193
public static function getOrCreate($name)
    {
        $db = Loader::db();
        $u = new User();
        $v = array($name, $u->getUserID());
        $q = "select pID from Piles where name = ? and uID = ?";
        $pID = $db->getOne($q, $v);

        if ($pID > 0) {
            return self::get($pID);
        }

        $v = array($u->getUserID(), 0, $name, 'READY');
        $q = "insert into Piles (uID, isDefault, name, state) values (?, ?, ?, ?)";
        $r = $db->query($q, $v);
        if ($r) {
            $pID = $db->Insert_ID();

            return self::get($pID);
        }
    }
413007
public function insert(string $name): bool
    {
        $this->name = $this->normalizeName($name);

        $this->preprocess();

        $filePath = $this->getTargetFilePath();

        if (!$this->needGenerate()) {
            return false;
        }

        $insertPosition = $this->getInsertPosition();
        $data           = $this->getInsertData();

        return $this->insertDataToLine($data, $filePath, $insertPosition);
    }
1073427
public function isCurrentMigration($name)
    {
        $current = $this->getCurrentMigration();

        return (!is_null($current) && $current->name == $name);
    }
1339148
protected function makeMigration()
    {
        $name = $this->argument('name');

        if ($this->files->exists($path = $this->getPath($name))) {
            return $this->error($this->type . ' already exists!');
        }

        $this->makeDirectory($path);

        $this->files->put($path, $this->compileMigrationStub());

        $this->info('Migration created successfully.');

        $this->composer->dumpAutoloads();
    }
925413
public function create($name)
    {
        $params = array(
            "tag" => array(
                "name" => $name
            )
        );
        $rst = $this->_request->post($this->_url . 'tags/create', $params);
        return $this->_client->rst($rst);
    }
1238543
public static function create($name)
    {
        if (!isset(self::$adapters[$name])) {
            throw HttpAdapterException::httpAdapterDoesNotExist($name);
        }

        if (!self::capable($name)) {
            throw HttpAdapterException::httpAdapterIsNotUsable($name);
        }

        return new self::$adapters[$name]['adapter']();
    }
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;
    }
1335123
private function create_package_migration($name) {
		list($packagename, $name) = explode('/', $name);

		$skeleton_packages = \Skeleton\Core\Skeleton::get_all();
		$package = null;
		foreach ($skeleton_packages as $skeleton_package) {
			if ($skeleton_package->name == $packagename) {
				$package = $skeleton_package;
			}
		}

		if ($package === null) {
			throw new \Exception('Package ' . $packagename . ' not found');
		}

		if (!file_exists($package->migration_path)) {
			mkdir($package->migration_path);
		}

		$name = preg_replace(array('/\s/', '/\.[\.]+/', '/[^\w_\.\-]/'), array('_', '.', ''), $name);

		$datetime = date('Ymd_His');
		$filename = $datetime . '_' . strtolower($name) . '.php';
		$classname = 'Migration_' . $datetime . '_' . ucfirst($name);

		$namespace_parts = explode('-', $package->name);
		foreach ($namespace_parts as $key => $namespace_part) {
			$namespace_parts[$key] = ucfirst($namespace_part);
		}
		$namespace = implode('\\', $namespace_parts);

		$template = file_get_contents(__DIR__ . '/../template/migration.php');
		$template = str_replace('%%namespace%%', 'namespace ' . $namespace . ';' . "\n", $template);
		$template = str_replace('%%classname%%', $classname, $template);
		file_put_contents($package->migration_path . '/' . $filename, $template);
		return $package->migration_path . '/' . $filename;
	}
1241448
public function copyMigration($name, $template)
    {
        $migrations = $this->getMigrations();

        // Check name not exists
        foreach ($migrations as $migration) {
            if (strtolower($name) == strtolower($migration['name'])) {
                throw new \RuntimeException(
                    'Migration: <info>' . $name . "</info> has exists. \nFile at: <info>" .
                    $migration['path'] . '</info>'
                );
            }
        }

        $date = gmdate('YmdHis');

        $file = $date . '_' . ucfirst($name) . '.php';

        $tmpl = file_get_contents($template);

        $tmpl = SimpleTemplate::render($tmpl, ['version' => $date, 'className' => ucfirst($name)]);

        // Get file path
        $filePath = $this->get('path') . '/' . $file;

        if (is_file($filePath)) {
            throw new \RuntimeException(sprintf('File already exists: %s', $filePath));
        }

        // Write it
        File::write($filePath, $tmpl);

        $this->out()->out('Migration version: <info>' . $file . '</info> created.');
        $this->out('File path: <info>' . realpath($filePath) . '</info>');
    }
735375
public static function import($name = null)
    {
        $file = static::last($name);

        if (!is_null($file)) {
            $query = (new Filesystem())->get($file);
            //
            Database::exec($query);

            return true;
        }
    }
797333
protected function getCreateMigrationName($name)
    {
        $filename = sprintf('%s_create_%s_table.php', date('Y_m_d_His'), strtolower($name));

        return Helpers::postFixWith($filename, '.php');
    }
231892
public function make(Connection $connection, $name = null)
    {
        if ($name && $this->config->has('migrations.' . $name)) {
            $config = new Repository($this->config->get('migrations.' . $name, []));
        } else {
            $config = new Repository($this->config->get('migrations.default', []));
        }

        $configuration = new Configuration($connection);
        $configuration->setName($config->get('name', 'Doctrine Migrations'));
        $configuration->setMigrationsNamespace($config->get('namespace', 'Database\\Migrations'));
        $configuration->setMigrationsTableName($config->get('table', 'migrations'));

        $configuration->getConnection()->getConfiguration()->setFilterSchemaAssetsExpression(
            $config->get('schema.filter', '/^(?).*$/')
        );

        $configuration->setNamingStrategy($this->container->make(
            $config->get('naming_strategy', DefaultNamingStrategy::class)
        ));

        $configuration->setMigrationsFinder($configuration->getNamingStrategy()->getFinder());

        $directory = $config->get('directory', database_path('migrations'));
        $configuration->setMigrationsDirectory($directory);
        $configuration->registerMigrationsFromDirectory($directory);

        return $configuration;
    }
859211
public static function connection($name)
    {
        $schema = static::$app['db']->connection($name)->getSchemaBuilder();
        $schema->blueprintResolver(function ($table, $callback) {
            return new Blueprint($table, $callback);
        });

        return $schema;
    }