Populating an index in USERS_TABLE, best approach.

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
3Di
Registered User
Posts: 11821
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano - Frankfurt
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
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 23702
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: 11821
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano - Frankfurt
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.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests