Handles the section create migration action
357189
protected function create($step)
    {
        foreach (array('name', 'identifier') as $key) {
            if (!isset($step->dsl[$key])) {
                throw new \Exception("The '$key' key is missing in a section creation definition");
            }
        }

        $sectionService = $this->repository->getSectionService();

        $sectionCreateStruct = $sectionService->newSectionCreateStruct();

        $sectionIdentifier = $this->referenceResolver->resolveReference($step->dsl['identifier']);
        $sectionCreateStruct->identifier = $sectionIdentifier;
        $sectionCreateStruct->name = $this->referenceResolver->resolveReference($step->dsl['name']);

        $section = $sectionService->createSection($sectionCreateStruct);

        $this->setReferences($section, $step);

        return $section;
    }
929915
public function executeMigrate()
	{
		$this->app->eloquent->getConnection()->useDefaultSchemaGrammar();

		$file = $this->app->path['app']->file($this->app->config->get('db.schema_path', 'database/schema.php'));

		if(!$file->isExists())
			throw new \Exception('['.$file.'] does not exists.');

		$file->load(array(
			'schema' => new \Laraquent\Schema($this->app->eloquent->getConnection())
			));
	}
206054
public function runMigration()
    {
        if ($this->confirm('Do you want to run all migration now?')) {
            $this->migrated = true;

            $this->console->call('migrate', [
                '--force' => $this->console->option('force'),
            ]);
        }
    }
1068068
def handle(self):
        
        database = self.option("database")
        repository = DatabaseMigrationRepository(self.resolver, "migrations")

        repository.set_source(database)
        repository.create_repository()

        self.info("Migration table created successfully")
173834
protected function createMigrationFile()
    {
        $fieldObjects = $this->getFields();

        if (@$fieldObjects['id']) {
            unset($fieldObjects['id']);
        }

        if (@$fieldObjects['created_at'] && @$fieldObjects['updated_at']) {
            $this->addGenericCall((new Base())->timestamps());

            unset($fieldObjects['created_at'], $fieldObjects['updated_at']);
        } // if

        if (@$fieldObjects['deleted_at']) {
            $this->addGenericCall((new Base())->softDeletes());

            unset($fieldObjects['deleted_at']);
        } // if

        $schema = implode(', ', $fieldObjects);

        if (strpos($schema, 'enum') !== false) {
            $this->getCommand()->info(sprintf('Please change the enum field of table "%s" manually.',
                $this->getName()));
        }

        if ($this->isPivotTable()) {
            $tables = array_keys($this->getForeignKeys());

            Artisan::call(
                'make:migration:pivot',
                [
                    'tableOne' => $tables[0],
                    'tableTwo' => $tables[1]
                ]
            );
        } else {
            Artisan::call(
                'make:migration:schema',
                [
                    'name' => "create_{$this->getName()}_table",
                    '--model' => $this->needsLaravelModel(),
                    '--schema' => $fieldObjects ? $schema : ''
                ]
            );

            $migrationFiles = glob(
                database_path('migrations') . DIRECTORY_SEPARATOR . "*_create_{$this->getName()}_table.php"
            );
        }

        return @$migrationFiles ? end($migrationFiles) : '';
    }
742663
function create(name) {
		var path = 'migrations/' + name + '.js';
		log('create', join(process.cwd(), path));
		fs.writeFileSync(path, template);
	}
559294
protected function createMigrationRepository(): void
    {
        $repository = $this->migrator->getRepository();

        if (! $repository->repositoryExists()) {
            $repository->createRepository();
        }
    }
33941
def execute(self, i, o):
        
        super(MigrateMakeCommand, self).execute(i, o)

        creator = MigrationCreator()

        name = i.get_argument('name')
        table = i.get_option('table')
        create = bool(i.get_option('create'))

        if not table and create is not False:
            table = create

        path = i.get_option('path')
        if path is None:
            path = self._get_migration_path()

        file_ = self._write_migration(creator, name, table, create, path)

        o.writeln('<info>Create migration: <comment>%s</comment></info>' % file_)
1238034
protected function doExecute()
    {
        $this->assistant->writeSection('Article classes generation');

        $this->createGenerator()->generate($this->bundle, $this->entity, $this->prefix, $this->getContainer()->getParameter('kunstmaan_admin.multi_language'), $this->usesAuthor, $this->usesCategories, $this->usesTags, $this->bundleWithHomePage, $this->dummydata);

        $this->assistant->writeSection('Article classes successfully created', 'bg=green;fg=black');
        $this->assistant->writeLine(array(
            'Make sure you update your database first before you test the pagepart:',
            '    Directly update your database:          <comment>bin/console doctrine:schema:update --force</comment>',
            '    Create a Doctrine migration and run it: <comment>bin/console doctrine:migrations:diff && bin/console doctrine:migrations:migrate</comment>',
        ));
    }
1258052
public function generateMigration()
    {
        if (!$this->confirm('Do you want to create a migration?')) {
            return;
        }

        $this->console->call('generate:migration', [
            'name' => "create_{$this->getEntities()}_table",
            '--fields' => $this->console->option('fields'),
            '--force' => $this->console->option('force'),
        ]);
    }
125842
protected function migrate()
    {
        if (! $this->container['migrator']->repositoryExists()) {
            throw new Exception('Migration table not found.');
        }

        $this->container['migrator']->run($this->getAttribute('path').'/database/migrations');
    }
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);
    }
768153
private function runMigration()
    {
        // Confirm connection and migration.
        $connection = $this->confirmConnectionAndMigration();

        // Load the migration class.
        $migration_class = $this->getMigrationClass();

        // Process the migration.
        $this->processMigration($connection, $migration_class);

        // Save this migration to the database/migrations folder.
        $this->createMigrationFile($connection, $migration_class);
    }
1281201
def create_migration
      migration_version = Time.now.to_i
      dir = "/db/migrate/#{migration_version}_create_#{@scaffold_name}s.rb"
      unless File.exists?(File.join(Dir.pwd,dir))
        source = "#{@gem_path}/lib/modules/scaffold/migration.rb"
        FileUtils.cp(source,File.join(Dir.pwd,dir))
        config_migration(migration_version)
        $stdout.puts "\e[1;32m \tcreate\e[0m\t#{dir}"
      end
    end
651561
protected function migrate()
    {
        $this->console->call(
            'migrate',
            ['--scope' => $this->addon->slug(), '--force' => true],
            $this->command ? $this->command->getOutput() : null
        );
    }
1058092
public function createSchema($config, $section, $table, $splitTable, $schema)
    {
        $migrationFiles = $this->filesystem->allFiles($this->getMigrationsPath($config));

        if (!empty($section)) {
            $migrationName = 'create_'.str_plural(strtolower(implode('_', $splitTable))).'_table';
        } else {
            $migrationName = 'create_'.str_plural(strtolower(snake_case($table))).'_table';
        }

        $parsedTable = '';

        $definitions = $this->calibrateDefinitions($schema);

        foreach ($definitions as $key => $column) {
            $columnDefinition = explode(':', $column);
            $columnDetails = explode('|', $columnDefinition[1]);
            $columnDetailString = $this->createColumnDetailString($columnDetails);

            if ($key === 0) {
                $parsedTable .= $this->getSchemaString($columnDetails, $columnDefinition, $columnDetailString);
            } else {
                $parsedTable .= "\t\t\t".$this->getSchemaString($columnDetails, $columnDefinition, $columnDetailString);
            }
        }

        if (isset($config['relationships']) && !is_null($config['relationships'])) {
            $relationships = explode(',', $config['relationships']);
            foreach ($relationships as $relationship) {
                $relation = explode('|', $relationship);

                if (isset($relation[2])) {
                    if (!stristr($parsedTable, "integer('$relation[2]')")) {
                        $parsedTable .= "\t\t\t\$table->integer('$relation[2]');\n";
                    }
                }
            }
        }

        foreach ($migrationFiles as $file) {
            if (stristr($file->getBasename(), $migrationName)) {
                $migrationData = $this->filesystem->get($file->getPathname());
                $migrationData = str_replace("\$table->increments('id');", $parsedTable, $migrationData);
                $this->filesystem->put($file->getPathname(), $migrationData);
            }
        }

        return $parsedTable;
    }
763669
public function newMigration()
    {
        $fileName = (isset($this->arguments[1])) ? $this->arguments[1] : null;
        $this->migrateManager->newMigration($fileName);
    }