Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Mac1 Posted November 13, 2020 Posted November 13, 2020 (edited) 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 November 13, 2020 by Mac1
Daniel F Posted November 13, 2020 Posted November 13, 2020 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 🙂
Mac1 Posted November 13, 2020 Author Posted November 13, 2020 (edited) 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. 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 November 13, 2020 by Mac1
Recommended Posts