Page 1 of 1
Possible to add new column or table to database?
Posted: Sat Jul 25, 2009 1:41 pm
by RickSilver
I have a need to track budgets for users and need to either add new columns to the database or add a new table.
Is this possible and if so, how?
Thanks
Rick
Re: Possible to add new column or table to database?
Posted: Sat Jul 25, 2009 4:30 pm
by jmestep
You can do either by accessing the SQL Server directly. A new table is preferable with a name that Able would never name it. If you add new fields to the existing table, you might run into problems at upgrade time.
Re: Possible to add new column or table to database?
Posted: Sat Jul 25, 2009 4:51 pm
by RickSilver
Thanks. How would I access the database? Is it usually stored with AbleCommerce? This is my first project with the software. Is there a free alternative to Sql Server Manager?
Rick
Re: Possible to add new column or table to database?
Posted: Mon Jul 27, 2009 3:00 am
by mazhar
Read about DAL and custom queries from here
http://wiki.ablecommerce.com/index.php/ ... uilder_API
Read following thread to auto generate code for you custom tables.
viewtopic.php?f=47&t=9530
By the way how many columns you would need? Are those columns or data would be needed for users only?
Re: Possible to add new column or table to database?
Posted: Mon Jul 27, 2009 7:21 am
by RickSilver
Thanks, I'll check those links. We want to add 3 columns: user_id, max budget, current budget, and prevent them from going over budget.
Rick
Re: Possible to add new column or table to database?
Posted: Mon Jul 27, 2009 7:31 am
by mazhar
You can also check user settings if it help you store your information. In this case there will be no need of creating custom columns etc and also DataPort would take care of importing/exporting that data in XML import/export. Read following thread about user settings
viewtopic.php?f=42&t=10487
Re: Possible to add new column or table to database?
Posted: Mon Jul 27, 2009 5:51 pm
by RickSilver
Thanks for the great info.
I think I'm going to use the ac_usersetting table as follows:
Example for user #1:
UserSettingID: (auto-incremented)
UserID: 1
FieldName: MaxBudget
FieldValue: 1000
UserSettingID: (auto-incremented)
UserID: 1
FieldName: CurrentBudget
FieldValue: 300
Rick