Creates migration table, when missing.

@return void
19583
protected function createMigrationsTable()
	{
		$db = $this->_context->getDatabase();

		$sql = "SELECT name
				FROM sqlite_master
				WHERE type = 'table' AND name = :table_name";
		$migrations_table = $db->fetchValue($sql, array('table_name' => 'Migrations'));

		if ( $migrations_table !== false ) {
			return;
		}

		$sql = 'CREATE TABLE "Migrations" (
					"Name" TEXT(255,0) NOT NULL,
					"ExecutedOn" INTEGER NOT NULL,
					PRIMARY KEY("Name")
				)';
		$db->perform($sql);
	}
935909
public function migrateUp()
    {
        $this->builder->table(
            $this->table,
            function ($table) {
                $table->integer('referer_id')->unsigned()->nullable()->index();
            }
        );
    }
856645
public function init(): void
    {
        parent::init();

        $this->_currentTable = $this->tableName;

        foreach ($this->skipMigrations as $index => $migration) {
            $this->skipMigrations[$index] = trim($migration, '\\');
        }
    }
216966
public function generateMigration()
    {
        if (!$this->confirm('Do you want to create a migration?')) {
            return;
        }

        $existing = $this->existing();
        $table = $this->getEntities();

        $this->console->call('generate:migration', [
            'name' => $existing ? $table : "create_{$table}_table",
            '--fields' => $this->console->option('fields'),
            '--force' => $this->console->option('force'),
            '--existing' => $existing,
        ]);
    }
1162164
protected function createMigrations()
    {
        file_put_contents(
            $this->createUsersVerificationsMigration(),
            file_get_contents(__DIR__.'/stubs/migrations/users_verifications.stub')
        );

        file_put_contents(
            $this->createUsersMigration(),
            file_get_contents(__DIR__.'/stubs/migrations/users.stub')
        );

        $this->info('Migrations created successfully!');
    }
112988
public function migrateUp()
    {
        $this->builder->table(
            $this->table,
            function ($table) {
                $table->string('medium')->nullable()->index();
                $table->string('source')->nullable()->index();
                $table->string('search_terms_hash')->nullable()->index();
            }
        );

        $this->builder->table($this->foreign, function ($table) {
            $table->foreign('referer_id', 'tracker_referers_referer_id_fk')
                ->references('id')
                ->on('tracker_referers')
                ->onUpdate('cascade')
                ->onDelete('cascade');
        });
    }
624501
public function migrateUp()
    {
        $this->builder->create(
            $this->table,
            function ($table) {
                $table->bigIncrements('id');

                $table->double('latitude')->nullable()->index();
                $table->double('longitude')->nullable()->index();

                $table->string('country_code', 2)->nullable()->index();
                $table->string('country_code3', 3)->nullable()->index();
                $table->string('country_name')->nullable()->index();
                $table->string('region', 2)->nullable();
                $table->string('city', 50)->nullable()->index();
                $table->string('postal_code', 20)->nullable();
                $table->bigInteger('area_code')->nullable();
                $table->double('dma_code')->nullable();
                $table->double('metro_code')->nullable();
                $table->string('continent_code', 2)->nullable();

                $table->timestamps();
                $table->index('created_at');
                $table->index('updated_at');
            }
        );
    }
143308
protected function createTables()
    {
        $this->createTable(static::tableName(), [
            'objectId' => $this->string()->notNull(),
            'elementId' => $this->integer()->notNull(),
            'fieldId' => $this->integer()->notNull(),
            'siteId' => $this->integer()->notNull(),
            'sortOrder' => $this->smallInteger()->unsigned(),
            'dateCreated' => $this->dateTime()->notNull(),
            'dateUpdated' => $this->dateTime()->notNull(),
            'uid' => $this->uid(),
        ]);
    }
676207
public function migrateUp()
    {
        Schema::create('tddd_projects', function (Blueprint $table) {
            $table->increments('id');

            $table->string('name');

            $table->string('path');

            $table->string('tests_path');

            $table->timestamps();
        });
    }
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;
    }
1092996
public function migrateUp()
    {
        try {
            $this->builder->table(
                $this->table,
                function ($table) {
                    $table->dropUnique('tracker_agents_name_unique');

                    $table->string('name_hash', 65)->nullable();
                }
            );

            Agent::all()->each(function ($agent) {
                $agent->name_hash = hash('sha256', $agent->name);

                $agent->save();
            });

            $this->builder->table(
                $this->table,
                function ($table) {
                    $table->unique('name_hash');
                }
            );
        } catch (\Exception $e) {
            dd($e->getMessage());
        }
    }
1221178
private function createMigrations()
    {
        $scripts   = $this->locator->findScripts();
        $rollbacks = $this->locator->findRollbackScripts();

        $this->releaseChecker->checkScripts($scripts, $rollbacks);

        foreach ($scripts as $k => $script) {
            $this->createMigration($script, $rollbacks[$k]);
        }
    }
1168592
public function createRepository()
	{
		$client = $this->getConnection()->getClient();

		$client->makeClass($this->table, function($table)
		{
			// The migrations table is responsible for keeping track of which of the
			// migrations have actually run for the application. We'll create the
			// table to hold the migration file's path as well as the version ID.
			$table->string('migration');

			$table->integer('version');
		})->save();
	}
488754
public function migrate()
    {
        $fs = new Filesystem;
        $finder = new ClassFinder;
        $path = env('MIGRATIONS_PATH', 'database/migrations');

        if ($fs->exists($path)) {
            foreach ($fs->files($path) as $file) {
                $fs->requireOnce($file);
                $class = $finder->findClass($file);

                (new $class)->up();
            }
        }
    }
887300
private function migration()
    {
        $migrationContent = "<?php\n\n".view('scaffold-interface::template.ManyToMany.migration', $this->tables)->render();

        $migrationFileName = date('Y').'_'.date('m').'_'.date('d').'_'.date('his').'_'.ucfirst($this->tables['first']).ucfirst($this->tables['second']).'.php';

        $this->make(config('amranidev.config.migration').'/'.$migrationFileName, $migrationContent);
    }
973777
protected function createMigration()
	{
		$data = ['table' => $this->argument('table'), 'attachment' => $this->argument('attachment')];
		$prefix = date('Y_m_d_His');
		$path = app_path() . '/database/migrations';

		if (!is_dir($path)) mkdir($path);

		$fileName  = $path . '/' . $prefix . '_add_' . $data['attachment'] . '_fields_to_' . $data['table'] . '_table.php';
		$data['className'] = 'Add' . ucfirst($data['attachment']) . 'FieldsTo' . ucfirst(Str::camel($data['table'])) . 'Table';

		// Save the new migration to disk using the laraclip migration view.
		$migration = View::make('laraclip::migration', $data)->render();
		File::put($fileName, $migration);

		// Dump the autoloader and print a created migration message to the console.
		$this->call('dump-autoload');
		$this->info("Created migration: $fileName");
	}
828571
protected function createTable()
    {
        if ($this->db->schema->getTableSchema($this->cacheTable) === null) {
            $this->db->createCommand()
                ->createTable($this->cacheTable, [
                    'id' => 'CHAR(128) PRIMARY KEY',
                    'expire' => 'integer',
                    'data' => 'binary',
                ])->execute();
        }
    }