Open lozovoyv opened 6 years ago
What do you do when you want to update the blueprint, without touching the old (already existing) migrations?
@Patryk27 Typically I define functions for one or several columns that are coming together. Looks like $table->timestamps()
creates two columns and $table->softdeletes()
creates one.
When is needed to add, modify or delete some column it can be done as usual. Just add migration that does changes.
Blueprint
has macros to add functionality without needing to extend, side note.
I think it would be very useful improvement for creating databases. This will help not to copy-paste lots of strings like
$table->string('meta_title')->nullable()
and so on, but use one or several blueprints libraries via packages or simple coping from project to project and incredibly speedup database developing with minimum type hints.I make additional classes for myself:
and then use it
Of course, this is not best solution in whole framework's architecture concepts, but it solves my problems. I had not dig framework sources so deep to check compatibility with different db connections. I`m using only default connection.