yiisoft / yiisoft/db-migration
Creating migration from SQL-files
Open
Nobody has claimed this yet.
type:feature
- Dominant language
- PHP
- Stars
- 32
- Forks
- 18
- Avg merge
- 22h 18m
- Merged PRs (30d)
- 2
Description
This is can be useful for creating migration based on SQL from vendor packages in application
Example of command:
./yii migrate/create --sql-up=/vendor/yiisoft/package/migrations/1/up.sql --sql-down=/vendor/yiisoft/package/migrations/1/down.sql
Result may be so:
public function up(MigrationBuilder $b): void
{
$b->execute('... sql from UP file ...');
}
public function down(MigrationBuilder $b): void
{
$b->execute('... sql from DOWN file ...');
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the migrate/create command entry point and trace how migration files are generated. Use the --sql-up and --sql-down examples as acceptance cases, checking how SQL file contents become the generated up() and down() methods. Done means both options produce a usable migration containing the corresponding SQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, sql
- Domain
- cli, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100