"Migration effectively installed"

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

"Migration effectively installed"

Post by Oleg »

What does that offer that could not have been achieved with recording which migrations have been run without actually running them?

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: "Migration effectively installed"

Post by bantu »

Bump.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: "Migration effectively installed"

Post by naderman »

Would be great to get some documentation on this as it was not in the original RFC.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: "Migration effectively installed"

Post by EXreaction »

Code: Select all

	/**
	* Allows you to check if the migration is effectively installed (entirely optional)
	*
	* This is checked when a migration is installed. If true is returned, the migration will be set as
	* installed without performing the database changes.
	* This function is intended to help moving to migrations from a previous database updater, where some
	* migrations may have been installed already even though they are not yet listed in the migrations table.
	*
	* @return bool True if this migration is installed, False if this migration is not installed (checked on install)
	*/

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: "Migration effectively installed"

Post by naderman »

Thank you!

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: "Migration effectively installed"

Post by Oleg »

Documentation is good to have but does not answer the question posed in the first post.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: "Migration effectively installed"

Post by naderman »

Oleg wrote:What does that offer that could not have been achieved with recording which migrations have been run without actually running them?
The way I understand the documentation is that this is exactly what effectively installed is used for. To figure out which migrations need to be on the record without having been run based on the current state of the database. Once the migration system has been installed as part of the update this information is no longer necessary, as the records of run migrations are then sufficient.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: "Migration effectively installed"

Post by Oleg »

A the other way of achieving the same effect, which works on all databases and is generally much simpler to implement, is to record a migration without running it.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: "Migration effectively installed"

Post by EXreaction »

That's exactly what happens if effectively installed is evaluated to true.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: "Migration effectively installed"

Post by naderman »

The purpose of the function is to identify which migrations need to be recorded without running them.

Post Reply