I am currently using RedBean version 3.5. I think I would like to move to the latest version of RedBean, version 4.
I have found no documentation about upgrade process, other than an indication it is not straightforward.
My questions are:
Is my RedBean 3.5 database schema compatible 4, or will up have to migrate all of the tables to some new format?
Is any of my RedBean 3.5 code compatible with version 4, or will I need to rewrite my code that uses RedBean 3.5?
I have taken the lack of answers provided for this question to be another sign that it is time for me to leave RedBean.
I have started the transition to Eloquent - Illuminate. I am just barely into the migration, and already I like Eloquent better, and I wish I had switched to it earlier. Some reasons why:
significantly more documentation available on the web
more explicit mechanism for defining entity relationships
control over table names
support for migrations
support for composer (RedBean 4 no longer provides this)
I was really looking forward to using the migration features to update my table names to more readable versions of the RedBean auto-created table names. Unfortunately, using artisan is not practical without a full install Laravel. So I will implement migrations with Phinx.
When I upgraded from RB3.x to RedBeanPHP Version 4 there was not much to do. I just exchanged rb.php library file, added some namespace stuff and this was just it. The database was left untouched and everything worked fine.
Nevertheless I am still using the Cooker plugin, because R::dispense( $beanAsArray ) does not load beans with id given and does not ignore empty fields which is needed when beans are coming from HTML forms.
RB4 is still available for use with Composer, as far as stated here https://github.com/gabordemooij/redbean.
Related
I am currently working on a code already made laravel 5.4 and I wonder if it is mandatory to update to the latest version and is it advisable to continue with this version(5.4) there. I really just need only basic stuff on laravel to do my project.
No, it is not required to upgrade the version but it is better if you can keep up, because each version might contain security patches alongside good features and improvements to the existing ones.
Laravel provides very simple upgrade guides that you can follow and if you upgrade them regularly there are almost zero breaking changes.
If you don't like doing it manually then there is a very good service called Laravel Shift which for a couple of bucks can help you with the upgrade.
As a developer I have to make a upfront commitment for 5 years support for a new Laravel project.
My question is - whether I should use Laravel's Long Term Support (LTS) version only?
What could be the potential pitfalls with regards to the support commitment if I use the latest Laravel 5.3 instead of the LTS version?
Any information regarding points to be considered like pros/cons with regards to the support commitment for 5 years when using the latest Laravel version versus using LTS version would help me make a correct decision.
To keep your application framework-agnostic, or to make it easier to swap out or not depend on the framework, the approach which worked the best for me was to isolate my business logic in separate libraries.
I handle those libraries using GITLab server, and I expose them to my composer via satis.
If you use Laravel's routing to map request to a controller, then you can use your library inside that controller and perform the rest of the work.
Constructing your app this way lets you:
isolate business logic
rely on framework to provide correct input since you can use middleware to filter out requests that don't fit.
have it easier when it comes to swapping the framework out
you're using composer, which lets you easily manage library and framework version(s)
This way, you can upgrade your app bit by bit as time goes by, you don't have to rely on having only one framework version forever, without being able to use newer releases.
Good luck with your project!
Is the Doctrine Migrations project compatible with Doctrine MongoDB?
It isn't clear to me from searching and looking at the Doctrine Migrations project whether it is compatible with ODM solutions (e.g. MongoDB) as well as ORM solutions.
If it is, can anyone suggest examples or articles on how to use the two together?
If it isn't, are there reasonable alternatives?
Question Background:
I understand, marginally, the different approaches to migrating a document's data from one version of the document to another and the pros and cons of each.
I am leaning towards possibly implementing a hybrid approach of gradual schema changes and migration scripts as suggested here. Leveraging the functionality within Doctrine's MongoDB library written about by Jonathan Wage in his post: Doctrine MongoDB ODM Schema Migrations.
Even with that, I need to find some way of creating a migration script or performing the data migration, and Doctrine Migrations seemed like a good first choice.
As an aside, another user warns against using the approach Jonathan Wage presents above for migrating data and instead running commands (JavaScript?) directly against the database.
Despite doctrine-migrations is not compabible with MongoDB ODM (it only supports DBAL) you can bet for the alternative mongo-based migration components made by 3rd party teams.
It was firstly developed here https://github.com/antimattr/mongodb-migrations
but after it has been abandoned the project continues here https://github.com/doesntmattr/mongodb-migrations
Ufortunately, it isn't compatible with ODM. It supports ORM only.
I'm looking for a good php framework with support for handling database migrations. Ideally I would like to be able to run a command that generates a migration script, one that updates the database with changes and can handle rolling back those changes. Is there anything out there that does this?
The Doctrine project supports migrations - http://www.doctrine-project.org/projects/migrations/2.0/docs/reference/introduction/en
Hmm, that documentation is a bit lacking, at least in the introduction. Hopefully it gets better as it goes on.
Whilst most popular in Symfony, this can easily be integrated into other frameworks or even used on its own.
Promising, but not yet have a stable version : https://github.com/fuel/fuel
There is a new php framework called Laravel and it has migrations the same way as ruby on rails. It seems so pretty!
You can find it at http://laravel.com/
Migrations Docs
In addition, the framework introduces the idea of bundles, what can give to your project a great modular view.
If you try it, tell us your experience! :)
symfony - http://www.symfony-project.org/
In symfony you can write database schema using ORM like Propel, it is independant from database driver. If you have a database already, you want to migrate to a different db, I think you can dump the db, change the db config, and re-import it to the new db. (though I have not tried it myself.)
There are much php framework over there that can use any database. For example Zend, Ci, Cake and many others. One thing you should do is change database type that's usually stored in configuration file. And then migrate your database manually. No framework that can generate migration script automatically. U can also use ESF for database migration
I need to load data from an old DB into a migrated schema of this DB using Doctrine migration system.
I guess Doctrine might help me in this process.
I tried and lost a few hours using ETL scripts programs, without success.
From my point of view I need to :
Create a DB with the V0 schema
Load the data from the old DB (schema are identical)
Migrate DB to latest version using Doctrine migration
Extract data
Load it in the new DB
WHat do you think of this process?
Do you think it is feasable using Doctrine?
I tried a few searches on Google without success.
I am currently reviewed the features of Doctrine_Core class.
Thanks for your help
Yes, it is possible to migrate data from one database to another using Doctrine.
It sounds like you're trying to do a one-time database revision and migration and that your applications are not currently written using Doctrine. In that scenario, database abstraction has little or no benefit, unless you're also rewriting the applications to use it.
If you have no prior experience using Doctrine then I seriously doubt that writing custom migration classes in it will be easier than doing it with whatever database API you are already experienced using. It makes sense to use the migration classes (some times) if you are already using Doctrine for your development. Otherwise it's another layer and API you don't need.
I'm using Doctrine 1.2, which has some nice features for migrations but also a number of bugs and omissions of expected functionality. Reportedly version 2 improves on this but I haven't used it yet.