Skip to content

If migration folder doesn't exist in phar binary#456

Merged
owenvoke merged 4 commits into
laravel-zero:masterfrom
dmouse:bug/validate-migration-folder
Jan 9, 2025
Merged

If migration folder doesn't exist in phar binary#456
owenvoke merged 4 commits into
laravel-zero:masterfrom
dmouse:bug/validate-migration-folder

Conversation

@dmouse

@dmouse dmouse commented Jan 21, 2022

Copy link
Copy Markdown
Contributor

When you create a phar if you don't include a migration file the folder is not included in your distribution binary, this cause an error when you run the migration command

   Symfony\Component\Finder\Exception\DirectoryNotFoundException 

  The "phar:///home/.../database/migrations" directory does not exist.

image

When you create a phar if you don't include a migration file the folder is not included in your distribution binary, this cause an error when you run the `migration` command
@owenvoke

owenvoke commented Jan 26, 2022

Copy link
Copy Markdown
Member

@nunomaduro, what are your thoughts on this? Seems fine to me. The alternative is just making sure that the migrations directory is in your box.json which is what I think we've previously recommended. However, this would cope with when there are no migrations but you still want to use the DB I guess?

@dmouse

dmouse commented Jan 26, 2022

Copy link
Copy Markdown
Contributor Author

Yes, my case is I'm using the dump command to generate the SQL file with all the schema and I want to use that SQL as base and create migration files out of the phar file.

As you mention to include the migration folder in the phar file I need migrations

@NotWorkingCode

Copy link
Copy Markdown

@nunomaduro

This problem is very relevant, especially if you intentionally do not use migrations, but use an existing database.
In this case, I must create an empty folder, otherwise I will get errors that the folder does not exist.

Could you consider this PR?

@owenvoke
owenvoke merged commit dd5d55d into laravel-zero:master Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants