You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, i have come up with a few ideas for adding migrations. Instead of having tables in the DB for marking the when and how of a migration to determine order of migration execution, we simply have a file where the order of definitions equals the order of migrations. you can easily create and delete a migration or add a migration via command line (This will simply add or remove a definition in the migration file).
The definition will be made up of a call to the build static method of DBSchema class. The first argument is the name of the "schema build" (so to speak). It will be a combination of the Model class name and a colon(:) followed by a UNIX timestamp of the current date and time. The second argument will be a closure that return the DB schema as an array.
The above block of code will be added using the command below
$ php jollof make:migration ChatMessages --build
The command above will receive standard input (stdin) for column names and their corresponding types and size. There will be no need to include the table name (as the schema will be automatically bound to the Model class which already has the table name). The command below will run the migration.
$ php jollof run:migration ChatMessages
The text was updated successfully, but these errors were encountered:
So, i have come up with a few ideas for adding migrations. Instead of having tables in the DB for marking the when and how of a migration to determine order of migration execution, we simply have a file where the order of definitions equals the order of migrations. you can easily create and delete a migration or add a migration via command line (This will simply add or remove a definition in the migration file).
The definition will be made up of a call to the build static method of DBSchema class. The first argument is the name of the "schema build" (so to speak). It will be a combination of the Model class name and a colon(:) followed by a UNIX timestamp of the current date and time. The second argument will be a closure that return the DB schema as an array.
The above block of code will be added using the command below
The command above will receive standard input (stdin) for column names and their corresponding types and size. There will be no need to include the table name (as the schema will be automatically bound to the Model class which already has the table name). The command below will run the migration.
The text was updated successfully, but these errors were encountered: