Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

how to update infusion?

Asked Modified Viewed 2,235 times
M
mawe4585
M
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 34 threads in the forums
  • Started this discussions
asked
Member

Hello,

i would like to know how i manage to have both, install command and update commands in one infusino, so that i'm able to install the infusion with the current version but also can install an update from 1.1 to 1.2, for example add a certain table from 1.1 to 1.2

i can't find update or install methods, but i know that the infusion.php is executed when updating, but how can i make update dependencies?
Edited by mawe4585 on 01-03-2012 22:52,
0 replies

6 posts

F
FILON
F
FILON 10
What's common between Halloween and Christmas? Every programmer knows: 31 oct = 25 dec.
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 14 threads in the forums
answered
Junior Member

You can change version of infusion, for examle, from 1.0 to 1.1. After that, infusion's name will be displayed in blue. You need to infuse it without defusing, so changes will be accepted.
Edited by FILON on 02-03-2012 06:11,
0 replies
M
mawe4585
M
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 34 threads in the forums
  • Started this discussions
answered
Member

thanks, i know that, but how about the sql changes?

for example:
in version 1.0 i add a table and insert 3 rows.
in version 1.1 i insert another 3 rows

now if i install the infusion with version 1.1 i have to add a table and insert 6 rows.
however if i have version 1.0 and update to version 1.1 i can assume that the table is there and the first 3 rows are also, so i only have to insert the last 3 rows.

i don't see the possibility in the infusion.php to differ wether i already have version 1.0 installed or not.
or in general i don't have the possibility to check if a table already is there and instead of add the table i only have to alter it.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Yes. You're right. You can only ALTER TABLE while updating infusion.

If you will have a look in the administration/infusions.php, you will find only this code for updating :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if ($inf_version > $data['inf_version']) {

if (isset($inf_altertable) && is_array($inf_altertable) && count($inf_altertable)) {

for ($i = 1; $i < (count($inf_altertable) + 1); $i++) {

$result = dbquery("ALTER TABLE ".$inf_altertable[$i]);

}

}

$result2 = dbquery("UPDATE ".DB_INFUSIONS." SET inf_version='".$inf_version."' WHERE inf_id='".$data['inf_id']."'"wink;

}[/syntaxhighlighter]
0 replies
M
mawe4585
M
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 34 threads in the forums
  • Started this discussions
answered
Member

it is not that important to create a new table, the thing is, how can i check if the version 1.0 was already installed so that i only have to insert three rows instead of six.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Quote

mawe4585 wrote:

it is not that important to create a new table, the thing is, how can i check if the version 1.0 was already installed so that i only have to insert three rows instead of six.


Then I think that you may create a custom Code in your Infusion itself which will check for your infusion's current version and make changes, say an Update button in your Infusion...

I hope you understood my point B)
0 replies
M
mawe4585
M
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 34 threads in the forums
  • Started this discussions
answered
Member

ah ok, yes i did, great idea :) maybe an infusion update admin panel or something :)

Merged on Mar 04 2012 at 13:55:30:
i ask myself, what is the internal update function good for if you can't actually do something except for alter tables?
as i see it, it does two things, alter the version number to the current one and alter tables if necessary.
Edited by mawe4585 on 04-03-2012 14:55,
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 6 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

M
M
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 34 threads in the forums
  • Started this discussions
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
F
F
FILON 10
What's common between Halloween and Christmas? Every programmer knows: 31 oct = 25 dec.
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 14 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet