Populating an index in USERS_TABLE, best approach.

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Populating an index in USERS_TABLE, best approach.

Post by 3Di »

Hi all,
before to code something about that I would like to know - based on your experience - what's the best and more elegant and functional (fast) approach to achieve the following goal:

phpBB 3.2.x ONLY.

For a new extension I need to create a migration (user schema) which takes care of creating a new index in the USERS_TABLE, so far so good. (I need the USERS_TABLE, no alternatives).

Now I want that index to be populated at the very first of the ext's installation, see ext.php, but that file executes before of any migration so I have to dismiss that migration and rely entirely on this.

ext.php should create the new index and populate it using a query, all of this code I have already written and tested. My doubt is where I will encounter a big board with lot of users, what's the best approach to let it run smoothly, in chunks maybe. Taking care as well of deleting the index on de-installation.


I don't know if that's dense, pls ask in case. :)

Any reference to an existing code will be appreciated, indeed.
TIA
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Populating an index in USERS_TABLE, best approach.

Post by Paul »

You should not do any scheme manipulations in ext.php, that will be a reason for deny.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Populating an index in USERS_TABLE, best approach.

Post by 3Di »

That's fine, thanks.
Back to where I started from then, let's forget about ext.php.

I do have a migration which already creates a user schema but the content of it it will become different on a per user basis, I can construct that content with an additional query (already written and tested) which I want to run once and for all (which could be heavy depending on how big the board is).

Furthermore the present code will UPDATE/INSERT/REPLACE only those indexes when and if is necessary.

The question still (as per the topic title) remains.

Thanks.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Post Reply

Return to “Extension Writers Discussion”