Page 1 of 1

Modified main table, then database view disappears

Posted: Wed Nov 30, 2022 8:33 pm
by konfuzion

Good thing I made a backup

I want to modify a few fields in main table, but then after I sync, the database view disappears, even worse is all the server events I custom created.

How can I modify the main table fields without losing the database view and custom server events?

All I did was rename 1 field:
from customer_id to customer_fk_id in main table, after sync, then the database view disappears.


Re: Modified main table, then database view disappears

Posted: Wed Nov 30, 2022 9:10 pm
by konfuzion

Solved, just as I suspected.

Before renaming the main table field, uncheck the field you want to rename in the database view by "alter view"
(so if I wanted to rename customer_id to customer_fk_id, I would need to uncheck [_] customer_id and save the view)

then go to phpmyadmin

rename the main table field from customer_id to customer_fk_id

save table

phpmaker sync db tables

check that the database view didn't disappear (yes, it is still there)

go back to that database view that I unchecked [_] customer_id

then edit "alter view"

will see the renamed field
[_] customer_fk_id

check the checkbox
[X] customer_fk_id

Save the view

check server events (all my custom code is still there)