Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process for Upgrading from RedBean 3.5 to RedBean 4

Tags:

php

orm

redbean

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?
like image 589
Jay Haase Avatar asked Aug 21 '14 04:08

Jay Haase


2 Answers

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.

like image 136
Jay Haase Avatar answered Nov 04 '22 05:11

Jay Haase


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.

like image 20
sah-comp Avatar answered Nov 04 '22 05:11

sah-comp