Jump to content

ActiveRecord table name without a prefix? Limitation


Recommended Posts

Hello, i'm developing an app which has some IPS sources extension that are not listed in Developer Center.

I'm creating an extension in sources directory which has ActiveRecord.
Everything works fine but there is a problem while i'm telling IPS about database table name.
IPS needs making database name as appname_tablename formula. My problem is i can't use appname_tablename but tablename instead.
 

This is how it works fine:

public static $databaseTable = 'myapp_tablename'; <-- this is working but i can't use that prefix

 

This is how i need to do it:

public static $databaseTable = 'tablename';

 

And of course tablename without myapp prefix doesn't work.. This is annoying and I don't know how to make it possible.
(I can't change table name - this is important because i'm rewriting my app from IP.Board 3 where it was possible of course..)

Edited by Mac1
Link to comment
Share on other sites

2 hours ago, Daniel F said:

You can create a second database instance to access your own tables.

To gain easy access to it, just override the db() method in your own AR implementation.

See also https://invisioncommunity.com/forums/topic/436728-custom-database-table-issue-with-ipsdbi/?do=findComment&comment=2684300 🙂

 

Thank you for response. I'm writing literally about making a serach index extension in my app which needs unfortunately a databaseTable as appname_tablename. Problem is in IPS Development "rules" and i think your solution won't help. Search index doesn't work when i'm trying to refresh it in Admin CP if my databaseTable is "tablename" without a prefix. Of course it works when i type appname_tablename in extension config file. 

image.png.68ea1ab18cde9cbbdd74d6290e1e418d.png

It works very well with appname_tablename but i need to make only tablename


Can I ask for help in solving this from the technical side? I would be very happy if Invision Community Team would help me to make it work without pushing prefix in config.

Edited by Mac1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...