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

Table Prefix only considered on up method #10

Closed
freestyledork opened this issue Aug 30, 2021 · 1 comment · Fixed by #11
Closed

Table Prefix only considered on up method #10

freestyledork opened this issue Aug 30, 2021 · 1 comment · Fixed by #11

Comments

@freestyledork
Copy link

Looks like a nice package. I was reviewing the code, I noticed you allow prefixing the table names. The migrations only use the prefix on the up() method. When calling down via a rollback, you could end up dropping a different table. Kind of a critical issue.

{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(config('workflows.db_prefix').'workflows', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('workflows');
    }
}
@Max-Hutschenreiter Max-Hutschenreiter linked a pull request Aug 31, 2021 that will close this issue
@Max-Hutschenreiter
Copy link
Contributor

Thanks! fixed it

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

Successfully merging a pull request may close this issue.

2 participants