Updated 037 Auto create SQL updates for Componets in JCB (markdown)

Amigo 2019-07-27 09:44:29 +02:00
parent 1069830754
commit 43dd7f73ee
1 changed files with 4 additions and 5 deletions

@ -34,13 +34,12 @@ The system is checking the history and it is making a lot of calculation to dyna
[00:05:44](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m44s)
This also works not only with the adding of a new view, but also if a field is added to an existing view. To demonstrate: If a new field gets added to the Preacher view and any fields is selected, since it is going to be removed again. For example: Call it 'Image'.(See video) [00:06:27](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m27s) Save and close. Now a new field has been added to preachers, and then return to the compiler, select the component and compile.<<<<<<<<<<<<<
Again since it detected there's been a field changed, it incremented the version number. If I install the component and we go to the component, to the preachers view, we'll now see [00:07:02](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m02s) that new field is there, image. If I was to select an image, and save. Oops I see I actually missed it, the reason was that this component didn't have any history. I had to go and make a few changes.
This also works not only with the adding of a new view, but also if a field is added to an existing view. To demonstrate: If a new field gets added to the Preacher view and any fields is selected, since it is going to be removed again. For example: Call it 'Image'.(See video) [00:06:27](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m27s) Save and close. Now a new field has been added to preachers, and then return to the compiler, select the component and compile. Since it detected there has been a field changed, it incremented the version number. If the component is installed, it may be seen in the component in the Preachers view, that there is a new field , 'image'.[00:07:02](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m02s) If an image is selected, and saved. _Oops, I actually missed it, the reason was that this component did not have any history. A few changes is necessary._
### If Building A Component It Have History
Take it into account that if you are building a component from the ground up, it will have history. [00:07:33](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m33s) This is only going to be happening when you have install a component via the import function in the components, or maybe using the demo component. I would advise open all the views and save them at least once, so that there is history recorded for that view. That is one of the drawbacks, there is really no way for me to my negate that issue. Since the history of each of these different items, being at the admin view and the fields needs to be created the moment that you saved the item. It can't be done before then. [00:08:14](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m14s) Taking that an account, I'll recompile it again and fix that. It should increment it to 1.4.3. I will install that again. Going back refreshing the preacher, we will see that image field is back. Select an image. Click save and now you'll see that it does store the data for this image. [00:08:49](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m49s) If we refresh the component, we will see that it is again incremented the version. If I open the update area, you will see that it added this new alter of the preacher table, adding the image field. It also added the new [00:09:16](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m16s) version to this list. That is a quick demonstration of this new automated feature. It is in its very beta phase. We still going to be working on it to make sure that it's completely stable.
[00:07:23](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m23s)
Take it into account that if you are building a component from the ground up, it will have history. This is only going to be happening when you have install a component via the import function in the components, or maybe using the demo component. I would advise open all the views and save them at least once, so that there is history recorded for that view. That is one of the drawbacks, there is really no way for me to my negate that issue. Since the history of each of these different items, being at the admin view and the fields needs to be created the moment that you saved the item. It can't be done before then. [00:08:14](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m14s) Taking that an account, I'll recompile it again and fix that. It should increment it to 1.4.3. I will install that again. Going back refreshing the preacher, we will see that image field is back. Select an image. Click save and now you'll see that it does store the data for this image. [00:08:49](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m49s) If we refresh the component, we will see that it is again incremented the version. If I open the update area, you will see that it added this new alter of the preacher table, adding the image field. It also added the new [00:09:16](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m16s) version to this list. That is a quick demonstration of this new automated feature. It is in its very beta phase. We still going to be working on it to make sure that it's completely stable.
Please take a go at it if you find any bugs, look for other open issues, which someone already reported, and start commenting on that what you think should be done. If you don't find any, then please open an issue and let us fix this issue. [00:09:55](https://www.youtube.com/watch?v=bRPJTRat158&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m55s) I think this will be a tremendous improvement to JCB, making it again with the one of the best Joomla component developing tools out there today. Where it is even writing your update SQL for you, being busy working and improving your component without being concerned about that.