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

the migration name prefixed by date twice! #143

Open
imami opened this issue Oct 7, 2024 · 0 comments
Open

the migration name prefixed by date twice! #143

imami opened this issue Oct 7, 2024 · 0 comments

Comments

@imami
Copy link

imami commented Oct 7, 2024

Steps to reproduce this issue:

  • having a migration file in the package.
  • the migration file is already prefixed by a date and time.
  • the package is configured with ->runsMigrations() in it's ServiceProvider.
  • publish the migrations of the package.
    then the published migration name would prefixed by date again!

I reproduced this issue not only in my private package, but also in filament-attachmate package, which has a migration named as
database/migrations/2024_02_24_192352_create_attachments_table.php

and the package's service provider is allowed to run migrations:

class FilamentAttachmateServiceProvider extends PackageServiceProvider
{

    public function configurePackage(Package $package): void
    {
        $package
            ->name('filament-attachmate')
            ->hasMigrations([
                '2024_02_24_192352_create_attachments_table'
            ])
            ->runsMigrations();
    }
}

everything is ok and the migration is successfully loaded.
but after publishing the migration, the published filename would be prefixed again with a new date time string:

  Copying file [vendor/zeeshantariq/filament-attachmate/database/migrations/2024_02_24_192352_create_attachments_table.php] to [database/migrations/2024_10_07_135947_2024_02_24_192352_create_attachments_table.php]  DONE

the published file is prefixed by 2024_10_07_135947_2024_02_24_192352_ which is the date in vendor's filename prefixed by published date!

Some changes in the generateMigrationName method might fix this issue.

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

1 participant