Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Migrations Bundle Laravel Package

dosfarma/migrations-bundle

View on GitHub
Deep Wiki
Context7

Migrations Bundle

Symfony framework integration for davedevelopment/phpmig

Setup

# config/bundles.php

return [
    DosFarma\MigrationsBundle\DosFarmaMigrationsBundle::class => ['dev' => true, 'test' => true],
];
# services.yaml

parameters:
  dos_farma.migrations.migrations_directory: '%kernel.project_dir%/migrations/postgresql/'
  dos_farma.migrations.migration_template: '%kernel.project_dir%/vendor/dosfarma/migrations-bundle/src/Resources/templates/dbalSql.php.twig'
  dos_farma.migrations.control_table: 'serviceschema.migrations'

services:
  DosFarma\MigrationsBundle\Infrastructure\Service\Phpmig\Adapter\Adapter:
    class: DosFarma\MigrationsBundle\Infrastructure\Service\Phpmig\Adapter\DbalAdapter
    public: false
    autoconfigure: true
    arguments:
      $connection: '@connection.dbal.myservice' # Doctrine DBAL Connection
      $tableName: '%dos_farma.migrations.control_table%'

  DosFarma\MigrationsBundle\Infrastructure\Service\Phpmig\ConfigurationContainer:
    public: true
    class: DosFarma\MigrationsBundle\Infrastructure\Service\Phpmig\ConfigurationContainer
    autoconfigure: true
    factory: DosFarma\MigrationsBundle\Infrastructure\Service\Phpmig\ConfigurationContainer::from
    arguments:
      $adapter: '@DosFarma\MigrationsBundle\Infrastructure\Service\Phpmig\Adapter\Adapter'
      $directory: '%dos_farma.migrations.migrations_directory%'
      $template: '%dos_farma.migrations.migration_template%'

Usage

  • Initialize the control table (needed just once):
    $ console migrations:init
    
  • View current migrations status:
    $ console migrations:status
    
    To use in batch scripts requiring non-zero return values on error, use:
    $ console migrations:check
    
  • Generate a new migration from template:
    $ console migrations:generate ThisIsTheMigrationSubject
    
  • Do pending migrations:
    $ console migrations:migrate
    
    To do migrations up to (stop in) specified migration id:
    $ console migrations:migrate --target 20201014114643
    
  • Rollback the last migration:
    $ console migrations:rollback
    
    To rollback down to specified migration id, use:
    $ console migrations:rollback --target 20201014114643
    
  • Up a migration id:
    $ console migrations:up 20201014114643
    
  • Down a migration id:
    $ console migrations:down 20201014114643
    
    To Re-Do (down and up) an already migrated id, you may use a single command:
    $ console migrations:redo 20201014114643
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky