Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request? !Schema::hasTable #183

Open
theWebKeyGuy opened this issue Mar 11, 2019 · 1 comment
Open

Feature Request? !Schema::hasTable #183

theWebKeyGuy opened this issue Mar 11, 2019 · 1 comment

Comments

@theWebKeyGuy
Copy link

Hello,

I was not sure if you have a area where I could put in a feature request as I could see this being very helpful including in the project I'm currently working on.

Feature:
I thought it would be cool if we could generate migrations that can auto have this feature in it so that way if I'm generating a migrations for a current project I don't accidentally overwrite databases tables on lets say my production server when I run php artisan migrate.

if (!Schema::hasTable('flights')) {
    Schema::create('flights', function (Blueprint $table) {
      $table->increments('id');
      $table->string('name');
      $table->string('airline');
      $table->timestamps();
    });
} 

The reason this would be useful is for someone like me that is working on a project that wasn't originally done in Laravel but I still need to work with the tables that they originally had from there old system to keep all of there current data. Again I'm sorry if I didn't post this in the right area or something but I just thought this would be really helpful in a lot of peoples cases.

@Soul-Killer-Ky
Copy link

I had the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants