You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Rakesh Venkatesh <ww...@gmail.com> on 2020/10/16 07:56:04 UTC

Automatically applying DB schema changes

Hello Users and Dev

Is there a way a new DB schema changes can be applied automatically
whenever I install new packages? My setup was running with two month old
changes of 4.15 and when I deployed new packages with latest changes, all
the recent db scheme changes are not applied and I need to run it manually.
How do I avoid it and how do you guys do it?

For example: This is the error I get

Caused by: java.sql.SQLSyntaxErrorException: Unknown column
'image_store.readonly' in 'field list'

and a big stack trace

This was fixed by applying changes from
https://github.com/apache/cloudstack/blob/master/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql#L198-L222


Another error was

Caused by: java.sql.SQLSyntaxErrorException: Unknown column
'project_invitations.account_role' in 'field list'


So I had to apply the schema needed for project_role related queries
-- 
Thanks and regards
Rakesh

Re: Automatically applying DB schema changes

Posted by Rakesh v <ww...@gmail.com>.
How about using flyway in master branch? We currently use it in our fork and whenever we make new schema changes they are automatically and no need for manual intervention

Sent from my iPhone

> On 16-Oct-2020, at 4:21 PM, Andrija Panic <an...@gmail.com> wrote:
> 
> No way automatically, manually is OK and the only way forward since you are
> on the same version all the time.
> 
> Best,
> 
>> On Fri, 16 Oct 2020, 10:00 Darrin Hüsselmann, <
>> Darrin.Husselmann@shapeblue.com> wrote:
>> 
>> Hi Rakesh,
>> 
>> db changes are applied automatically if the Cloudstack version changes and
>> there is an upgrade path in the code, I think you may have not changed
>> version.
>> 
>> Cheers
>> Darrin
>> ________________________________
>> From: Rakesh Venkatesh <ww...@gmail.com>
>> Sent: Friday, October 16, 2020 9:56 AM
>> To: users <us...@cloudstack.apache.org>; dev <de...@cloudstack.apache.org>
>> Subject: Automatically applying DB schema changes
>> 
>> Hello Users and Dev
>> 
>> Is there a way a new DB schema changes can be applied automatically
>> whenever I install new packages? My setup was running with two month old
>> changes of 4.15 and when I deployed new packages with latest changes, all
>> the recent db scheme changes are not applied and I need to run it manually.
>> How do I avoid it and how do you guys do it?
>> 
>> For example: This is the error I get
>> 
>> Caused by: java.sql.SQLSyntaxErrorException: Unknown column
>> 'image_store.readonly' in 'field list'
>> 
>> and a big stack trace
>> 
>> This was fixed by applying changes from
>> 
>> https://github.com/apache/cloudstack/blob/master/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql#L198-L222
>> 
>> 
>> Another error was
>> 
>> Caused by: java.sql.SQLSyntaxErrorException: Unknown column
>> 'project_invitations.account_role' in 'field list'
>> 
>> 
>> So I had to apply the schema needed for project_role related queries
>> --
>> Thanks and regards
>> Rakesh
>> 
>> Darrin.Husselmann@shapeblue.com
>> www.shapeblue.com
>> 3 London Bridge Street,  3rd floor, News Building, London  SE1 9SGUK
>> @shapeblue
>> 
>> 
>> 
>> 

Re: Automatically applying DB schema changes

Posted by Andrija Panic <an...@gmail.com>.
No way automatically, manually is OK and the only way forward since you are
on the same version all the time.

Best,

On Fri, 16 Oct 2020, 10:00 Darrin Hüsselmann, <
Darrin.Husselmann@shapeblue.com> wrote:

> Hi Rakesh,
>
> db changes are applied automatically if the Cloudstack version changes and
> there is an upgrade path in the code, I think you may have not changed
> version.
>
> Cheers
> Darrin
> ________________________________
> From: Rakesh Venkatesh <ww...@gmail.com>
> Sent: Friday, October 16, 2020 9:56 AM
> To: users <us...@cloudstack.apache.org>; dev <de...@cloudstack.apache.org>
> Subject: Automatically applying DB schema changes
>
> Hello Users and Dev
>
> Is there a way a new DB schema changes can be applied automatically
> whenever I install new packages? My setup was running with two month old
> changes of 4.15 and when I deployed new packages with latest changes, all
> the recent db scheme changes are not applied and I need to run it manually.
> How do I avoid it and how do you guys do it?
>
> For example: This is the error I get
>
> Caused by: java.sql.SQLSyntaxErrorException: Unknown column
> 'image_store.readonly' in 'field list'
>
> and a big stack trace
>
> This was fixed by applying changes from
>
> https://github.com/apache/cloudstack/blob/master/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql#L198-L222
>
>
> Another error was
>
> Caused by: java.sql.SQLSyntaxErrorException: Unknown column
> 'project_invitations.account_role' in 'field list'
>
>
> So I had to apply the schema needed for project_role related queries
> --
> Thanks and regards
> Rakesh
>
> Darrin.Husselmann@shapeblue.com
> www.shapeblue.com
> 3 London Bridge Street,  3rd floor, News Building, London  SE1 9SGUK
> @shapeblue
>
>
>
>

Re: Automatically applying DB schema changes

Posted by Darrin Hüsselmann <Da...@shapeblue.com>.
Hi Rakesh,

db changes are applied automatically if the Cloudstack version changes and there is an upgrade path in the code, I think you may have not changed version.

Cheers
Darrin
________________________________
From: Rakesh Venkatesh <ww...@gmail.com>
Sent: Friday, October 16, 2020 9:56 AM
To: users <us...@cloudstack.apache.org>; dev <de...@cloudstack.apache.org>
Subject: Automatically applying DB schema changes

Hello Users and Dev

Is there a way a new DB schema changes can be applied automatically
whenever I install new packages? My setup was running with two month old
changes of 4.15 and when I deployed new packages with latest changes, all
the recent db scheme changes are not applied and I need to run it manually.
How do I avoid it and how do you guys do it?

For example: This is the error I get

Caused by: java.sql.SQLSyntaxErrorException: Unknown column
'image_store.readonly' in 'field list'

and a big stack trace

This was fixed by applying changes from
https://github.com/apache/cloudstack/blob/master/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql#L198-L222


Another error was

Caused by: java.sql.SQLSyntaxErrorException: Unknown column
'project_invitations.account_role' in 'field list'


So I had to apply the schema needed for project_role related queries
--
Thanks and regards
Rakesh

Darrin.Husselmann@shapeblue.com 
www.shapeblue.com
3 London Bridge Street,  3rd floor, News Building, London  SE1 9SGUK
@shapeblue