Groups
Groups
Sign in
Groups
Groups
redbeanphp
Conversations
About
Send feedback
Help
Create structure without storing record / Check if table exists
77 views
Skip to first unread message
Patrick
unread,
Jul 12, 2014, 6:33:11 PM
7/12/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to redbe...@googlegroups.com
Is there an easy way to have RedBean create any needed tables / add any needed columns without storing a bean?
And a somewhat related question: is there an easy way to check and see if a table exists?
gabor
unread,
Jul 13, 2014, 3:31:20 AM
7/13/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to redbe...@googlegroups.com
This is easy to do:
Adding a column is as simple as invoking $writer->addColumn(), see documentation here:
http://redbeanphp.com/api/interface_red_bean_p_h_p_1_1_query_writer.html#ac7b4f710cab9bb5bb010c57ec8a4f276
To determine whether a table already exists, simply ask for all tables:
$tables = R::inspect();
cheers
Gabor
Reply all
Reply to author
Forward
0 new messages