Jump to content

Adding columns to existing tables for application

Featured Replies

Posted

Hey,

i ran into a small issue.
I've added extensions for GroupForm & MemberForm to add new permission sets.

For that I need to extend the table of core_groups & core_members afaik.

How can I do that? The only solution I found was the installer query, or is that actually the solution?

For apps, you should add your queries in Versions tab. Those columns will be dropped when you uninstall the app.

6 minutes ago, Michael Schneider said:

Cool. Good to know, thanks for the hint :-) But I'm not able to view it :-(

 

Ignore my reply:unsure:. Adriano is correct, you don't need to take care of this if you use the queries.json file.

  • Author
Just now, Daniel F said:

Ignore my reply:unsure:. Adriano is correct, you don't need to take care of this if you use the queries.json file.

Okay, thanks :)

  • Author
1 hour ago, Adriano Faria said:

For apps, you should add your queries in Versions tab. Those columns will be dropped when you uninstall the app.

I got still an issue.

I have added the queries, build the application and deployed it, but for some reason the queries where not deployed.

Some minor code parts:

Screen Shot 2016-11-25 at 22.06.50.png

Screen Shot 2016-11-25 at 22.04.25.png

The repository is also up to date and here: https://github.com/gamershost/Forum-Report-Archive

The error is about core_members. Your queries are for core_groups.

9 hours ago, Michael Schneider said:

No, sorry that image was really bad choosen.

Here is the whole file with core_members queries:

https://github.com/gamershost/Forum-Report-Archive/blob/master/setup/upg_10000/queries.json#L281-L392

These queries (for core_members, core_groups) should be in setup/install/queries.json not upgrade

ACP - System - Applications - your app - Developer center - Versions - Installation Routine - Add SQL Query

You indicated you built the application and deployed it, which leaves some gray area here. Are you testing against a test install, but pushing your code to a production installation once you are happy with it? Does it share the same database? If not, you will need to run the upgrader (siteUrl/admin/upgrade/ by default) and upgrade your application on your production installation to run the database changes.

  • Author
3 hours ago, bfarber said:

You indicated you built the application and deployed it, which leaves some gray area here. Are you testing against a test install, but pushing your code to a production installation once you are happy with it? Does it share the same database? If not, you will need to run the upgrader (siteUrl/admin/upgrade/ by default) and upgrade your application on your production installation to run the database changes.

Hey,

thanks for following up, yes i develop on a local test install and once im happy i install it on my production server.
Of course the databases are fully split up. Who develops on a production database? :unsure:
So far the solution @newbie LAC noted is working for me as expected.

Or is there anything wrong with what i am doing at the moment?

 

The post from newbie LAC outlines how to add the columns on the development install, but that wouldn't adjust the production install based on my understanding. Nevertheless if you have a working setup, that's great.

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.