Modify existing view?

jason

New member
You are using DaDaBIK version 10.1-Manarola enterprise, installed on 05-15-2020 (installation code: 155165ebef2d6ed236), the latest version of DaDaBIK is 10.1-Manarola released on 03-09-2020
PHP Version: 7.2.30
mysql version: 5.6.47-cll-lve
Web server: Apache
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0

Hi there. I have created a page based on a view I have created. I have set the permissions and configured the form, and have since realized I needed to add some new fields to the table the view is based on and need those fields reflected in the view.

Is there any way to edit or modify a view, or even create a new view and transfer all of the permissions and form settings from the old to the new? It is incredibly time consuming having to rebuild everything from scratch when needing to modify a view. Intuitively expected a "Modify" button in the Data - Views section but the only option is to Create or Delete.
 

jason

New member
Answered my own question: I can't find a way to do it in Dadabik (would be very nice feature to have) but if you log into the MySQL Workbench, and go to the VIEWS section under the table, I wasn't able to modify the view because I didn't have "SUPER" privileges. That was a whole other rabbit hole to go down, but you can right click on views and create a new view, name it the same as your existing view, and run the query and it will replace the existing view with the new fields.

Then go into Dadabik and DBSyncro then click the "add fields" button for it to see the new fields in the view.

Saves having to rebuild everything.
 
Thanks for the post. I was just struggling with the same issue and had similar suspicions about changes on the DaDaBik side of things but didn't think to try to change the view from the database side to save some work.I have 3-4 iterations of a view I've been tweaking with all slightly similar names and with no way to see the query behind the view it gets a bit confusing. It would be helpful to at least save the view text for reference (even if it could not be changed) or even have a comment or description more specific than the view name accessible in the admin area. I will probably add this to the feature request forum.
 

eugenio

Administrator
Staff member
Hello,
you can't modify a VIEW in mysql as you do with a table, you basically have to re-build it.
At the moment what I suggest is to keep track of the code you used a for a view when you created it.

You can also use the SHOW CREATE VIEW view_name code in SQL (the code you get can be slightly different respect to the one you originally used).


Best,
 
Top