The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database prefix
#1
I'm trying to install UserSpice and am having problems with the database part of the install - namely, I already have a table called settings. Is there an easy way to add a prefix to all the tables?
  Reply
#2
I can't think of an easy way to do this.

My thought would be to temporarily rename your table to settings3. Install userspice. Rename the userspice table to settings2 and your settings 3 back to settings.

From there you can do a find/replace and there are only a few changes...

To take care of the queries...
Find
FROM settings
replace with
FROM settings2

To take care of the times we update the settings....
update('settings'
and replace with
update('settings2'

My gut says userspice will work fine if you do that. If not, you can always reinstall.
  Reply
#3
I realized that I may have not thought through your issue all the way. What's in your current settings table? Could the userspice columns just be added to your existing settings table?

We could write a little patch where userspice doesn't try to update the settings table on install and then we could append the proper columns to your settings table.
  Reply
#4
I have all of the settings for my web application in the settings table. Unfortunately, I don't think I can simply append columns to my existing settings table - it's currently set up in a key/value configuration and there are many rows per user. I'll maybe try your suggestion in the first reply.

I am actually using an old version of UserSpice (not sure exactly which one, but it was one that has all the old UserCake table structures). So all my current user tables are prefixed with uc_ . I actually really like it that way because it groups all the user management stuff together in the database, without 'mixing' together with all my other tables. Maybe something to consider for the future.

Thanks!
  Reply
#5
If you're going to build off of UserSpice 3, I recommend 3.2 as opposed to 3.3. If you're going to stick with UserSpice 3, then version 3.2 has an upgrade path to 4.0 then 4.1. If you're determined to stay on 3 with the more procedural php, then 3.3 is a fantastic version and has some of the features that 4.1 still doesn't have (including the db prefixes etc).

I really do think you'll be fine calling our settings table settings2. Every once in a while a patch might break something, but it will be super easy to track things down since we only update a few files at a time and the things that break will be really obvious.
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)