Redbean php R::freeze(true) not working

389 views Asked by At

I have used R::freeze(true); in my php application. But I don't know why redbean alters my database table structure. I noticed that interger type column becomes text automatically.

Also i have updated variable protected $isFrozen = TRUE; in rb.php. But no effect.

2

There are 2 answers

0
Jeremy Schaffer On BEST ANSWER

Without knowing your PHP structure or framework (if any), it's impossible to provide any answer in relation to that. In any event, R::freeze( true ) is the correct syntax. Make sure you add the statement in the beginning of your application.

I have a lot of SlimPHP applications using ReadBean and I put it at the very top of my index.php right after running R::setup();

<?php

require 'vendor/autoload.php';
R::setup();
R::freeze( true );
2
mahesh kajale On

Thanks @Jeremy Schaffer,

R::freeze(true);

The above code is correct. But my application uses multiple database connection. and then i realize that for every connection we need to use above line of code to freeze db structure.

The problem is resolved.