You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Kuang-Ching Wang <ku...@gmail.com> on 2014/09/29 03:11:24 UTC
how to add new data table to DB
Hi,
I need to create a new table to store data in the cloudstack DB. I followed existing examples to:
- add a new VO class, with @Entity and @Table(name = “new_table_name")
- add a new Dao interface
- add a new DaoImpl class for the interface
- update spring context (of my network plugin) with a new bean id for the new DaoImpl class
I was expecting with the change and a reinstall of my cloudstack-management service (even doing cloudstack-setup-databases again), a new table would be created. However, this is not happening.
Is there some step I missed?
Thanks,
KC
Re: how to add new data table to DB
Posted by Kuangching Wang <kw...@clemson.edu>.
By convention, which file should I add to? create-database.sql?
KC
On Sep 28, 2014, at 9:07 PM, Abhinandan Prateek <ag...@gmail.com> wrote:
> You still need to write Sql for creating new db table in MySQL db.
>
> -abhi
>
>> On 29-Sep-2014, at 6:41 am, Kuang-Ching Wang <ku...@gmail.com> wrote:
>>
>> Hi,
>>
>> I need to create a new table to store data in the cloudstack DB. I followed existing examples to:
>> - add a new VO class, with @Entity and @Table(name = “new_table_name")
>> - add a new Dao interface
>> - add a new DaoImpl class for the interface
>> - update spring context (of my network plugin) with a new bean id for the new DaoImpl class
>>
>> I was expecting with the change and a reinstall of my cloudstack-management service (even doing cloudstack-setup-databases again), a new table would be created. However, this is not happening.
>>
>> Is there some step I missed?
>>
>> Thanks,
>> KC
--
Dr. Wang, Kuang-Ching, Associate Professor
308 Fluor Daniel Building
ECE Department, Clemson University
Clemson, SC 29634
864-656-0846 (Office)
864-656-7220 (Fax)
kwang@clemson.edu
Re: how to add new data table to DB
Posted by Kuangching Wang <kw...@clemson.edu>.
Why 440to441? What’s the convention to choose which .sql file to add to? I am working against master, which is 4.5.0.
KC
On Sep 28, 2014, at 9:25 PM, Jayapal Reddy Uradi <ja...@citrix.com> wrote:
> You need to add you create table entries in schema-440to441.sql.
>
> If you do not want to redeploy (without using cloudstack-setup-databases) you can go to mysql prompt, use cloud db and create table.
> After creating table restart the MS will work.
>
> Thanks,
> Jayapal
>
> On 29-Sep-2014, at 9:37 AM, Abhinandan Prateek <ag...@gmail.com> wrote:
>
>> You still need to write Sql for creating new db table in MySQL db.
>>
>> -abhi
>>
>>> On 29-Sep-2014, at 6:41 am, Kuang-Ching Wang <ku...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I need to create a new table to store data in the cloudstack DB. I followed existing examples to:
>>> - add a new VO class, with @Entity and @Table(name = “new_table_name")
>>> - add a new Dao interface
>>> - add a new DaoImpl class for the interface
>>> - update spring context (of my network plugin) with a new bean id for the new DaoImpl class
>>>
>>> I was expecting with the change and a reinstall of my cloudstack-management service (even doing cloudstack-setup-databases again), a new table would be created. However, this is not happening.
>>>
>>> Is there some step I missed?
>>>
>>> Thanks,
>>> KC
>
--
Dr. Wang, Kuang-Ching, Associate Professor
308 Fluor Daniel Building
ECE Department, Clemson University
Clemson, SC 29634
864-656-0846 (Office)
864-656-7220 (Fax)
kwang@clemson.edu
Re: how to add new data table to DB
Posted by Jayapal Reddy Uradi <ja...@citrix.com>.
You need to add you create table entries in schema-440to441.sql.
If you do not want to redeploy (without using cloudstack-setup-databases) you can go to mysql prompt, use cloud db and create table.
After creating table restart the MS will work.
Thanks,
Jayapal
On 29-Sep-2014, at 9:37 AM, Abhinandan Prateek <ag...@gmail.com> wrote:
> You still need to write Sql for creating new db table in MySQL db.
>
> -abhi
>
>> On 29-Sep-2014, at 6:41 am, Kuang-Ching Wang <ku...@gmail.com> wrote:
>>
>> Hi,
>>
>> I need to create a new table to store data in the cloudstack DB. I followed existing examples to:
>> - add a new VO class, with @Entity and @Table(name = “new_table_name")
>> - add a new Dao interface
>> - add a new DaoImpl class for the interface
>> - update spring context (of my network plugin) with a new bean id for the new DaoImpl class
>>
>> I was expecting with the change and a reinstall of my cloudstack-management service (even doing cloudstack-setup-databases again), a new table would be created. However, this is not happening.
>>
>> Is there some step I missed?
>>
>> Thanks,
>> KC
Re: how to add new data table to DB
Posted by Abhinandan Prateek <ag...@gmail.com>.
You still need to write Sql for creating new db table in MySQL db.
-abhi
> On 29-Sep-2014, at 6:41 am, Kuang-Ching Wang <ku...@gmail.com> wrote:
>
> Hi,
>
> I need to create a new table to store data in the cloudstack DB. I followed existing examples to:
> - add a new VO class, with @Entity and @Table(name = “new_table_name")
> - add a new Dao interface
> - add a new DaoImpl class for the interface
> - update spring context (of my network plugin) with a new bean id for the new DaoImpl class
>
> I was expecting with the change and a reinstall of my cloudstack-management service (even doing cloudstack-setup-databases again), a new table would be created. However, this is not happening.
>
> Is there some step I missed?
>
> Thanks,
> KC
Re: how to add new data table to DB
Posted by Nitin Mehta <Ni...@citrix.com>.
I kind of agree with Mike. We shouldn¹t really be adding tables with
plugins. If there is a need to do so then its a limitation with our plugin
framework and should be enhanced accordingly.
It would good if you could specify your use case and why it can't be
fitted with existing schema.
Thanks,
-Nitin
On 08/10/14 11:07 AM, "Kuang-Ching Wang" <ku...@gmail.com> wrote:
>Thanks Mike, I added the table successfully.
>
>And also thanks for the suggestion. I spent some time looking into what
>we need - we need to store some topology/tenant mapping info specific to
>our plugin for syncing purpose. Logically it really needs to be
>maintained in a separate table. Similar practice has been adopted by
>some other network-element plugins as well.
>
>Thanks,
>KC
>
>
>On Sep 28, 2014, at 9:23 PM, Mike Tutkowski
><mi...@solidfire.com> wrote:
>
>> Assuming you are doing this for version 4.5, please take a look at
>>adding your table to this file:
>>
>> schema-441to450.sql
>>
>> By the way, do we really need to add a new table for this plug-in or is
>>there some "*_details" table (ex. storage_pool_details) where you can
>>store information specific to your needs?
>>
>> Thanks
>>
>> On Sun, Sep 28, 2014 at 7:11 PM, Kuang-Ching Wang
>><ku...@gmail.com> wrote:
>> Hi,
>>
>> I need to create a new table to store data in the cloudstack DB. I
>>followed existing examples to:
>> - add a new VO class, with @Entity and @Table(name = ³new_table_name")
>> - add a new Dao interface
>> - add a new DaoImpl class for the interface
>> - update spring context (of my network plugin) with a new bean id for
>>the new DaoImpl class
>>
>> I was expecting with the change and a reinstall of my
>>cloudstack-management service (even doing cloudstack-setup-databases
>>again), a new table would be created. However, this is not happening.
>>
>> Is there some step I missed?
>>
>> Thanks,
>> KC
>>
>>
>>
>> --
>> Mike Tutkowski
>> Senior CloudStack Developer, SolidFire Inc.
>> e: mike.tutkowski@solidfire.com
>> o: 303.746.7302
>> Advancing the way the world uses the cloud
>
Re: how to add new data table to DB
Posted by Kuang-Ching Wang <ku...@gmail.com>.
Thanks Mike, I added the table successfully.
And also thanks for the suggestion. I spent some time looking into what we need - we need to store some topology/tenant mapping info specific to our plugin for syncing purpose. Logically it really needs to be maintained in a separate table. Similar practice has been adopted by some other network-element plugins as well.
Thanks,
KC
On Sep 28, 2014, at 9:23 PM, Mike Tutkowski <mi...@solidfire.com> wrote:
> Assuming you are doing this for version 4.5, please take a look at adding your table to this file:
>
> schema-441to450.sql
>
> By the way, do we really need to add a new table for this plug-in or is there some "*_details" table (ex. storage_pool_details) where you can store information specific to your needs?
>
> Thanks
>
> On Sun, Sep 28, 2014 at 7:11 PM, Kuang-Ching Wang <ku...@gmail.com> wrote:
> Hi,
>
> I need to create a new table to store data in the cloudstack DB. I followed existing examples to:
> - add a new VO class, with @Entity and @Table(name = “new_table_name")
> - add a new Dao interface
> - add a new DaoImpl class for the interface
> - update spring context (of my network plugin) with a new bean id for the new DaoImpl class
>
> I was expecting with the change and a reinstall of my cloudstack-management service (even doing cloudstack-setup-databases again), a new table would be created. However, this is not happening.
>
> Is there some step I missed?
>
> Thanks,
> KC
>
>
>
> --
> Mike Tutkowski
> Senior CloudStack Developer, SolidFire Inc.
> e: mike.tutkowski@solidfire.com
> o: 303.746.7302
> Advancing the way the world uses the cloud™
Re: how to add new data table to DB
Posted by Mike Tutkowski <mi...@solidfire.com>.
Assuming you are doing this for version 4.5, please take a look at adding
your table to this file:
schema-441to450.sql
By the way, do we really need to add a new table for this plug-in or is
there some "*_details" table (ex. storage_pool_details) where you can store
information specific to your needs?
Thanks
On Sun, Sep 28, 2014 at 7:11 PM, Kuang-Ching Wang <kuangching.wang@gmail.com
> wrote:
> Hi,
>
> I need to create a new table to store data in the cloudstack DB. I
> followed existing examples to:
> - add a new VO class, with @Entity and @Table(name = “new_table_name")
> - add a new Dao interface
> - add a new DaoImpl class for the interface
> - update spring context (of my network plugin) with a new bean id for the
> new DaoImpl class
>
> I was expecting with the change and a reinstall of my
> cloudstack-management service (even doing cloudstack-setup-databases
> again), a new table would be created. However, this is not happening.
>
> Is there some step I missed?
>
> Thanks,
> KC
--
*Mike Tutkowski*
*Senior CloudStack Developer, SolidFire Inc.*
e: mike.tutkowski@solidfire.com
o: 303.746.7302
Advancing the way the world uses the cloud
<http://solidfire.com/solution/overview/?video=play>*™*