Populating an index in USERS_TABLE, best approach.

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
3Di
Registered User
Posts: 13151
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Populating an index in USERS_TABLE, best approach.

Post by 3Di » Fri Oct 13, 2017 11:51 pm

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
:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 24810
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 » Sat Oct 14, 2017 1:30 am

You should not do any scheme manipulations in ext.php, that will be a reason for deny.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
3Di
Registered User
Posts: 13151
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Populating an index in USERS_TABLE, best approach.

Post by 3Di » Sat Oct 14, 2017 1:39 am

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.
:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: caiocald, GanstaZ, Toxyy and 12 guests