Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-09 07:11:10

Siguo
Member
From: Beijing, China
Registered: 2008-05-22
Posts: 44

missing load_order field in setup sql?

hi, I know there is a load_order field in txp_plugin table.

but I checked the setup sql file, it’s like this:

$create_sql[] = “CREATE TABLE `”.PFX.“txp_plugin` ( `name` varchar(64) NOT NULL default ‘’, `status` int(2) NOT NULL default ‘1’, `author` varchar(128) NOT NULL default ‘’, `author_uri` varchar(128) NOT NULL default ‘’, `version` varchar(10) NOT NULL default ‘1.0’, `description` text NOT NULL, `help` text NOT NULL, `code` text NOT NULL, `code_restore` text NOT NULL, `code_md5` varchar(32) NOT NULL default ‘’, `type` int(2) NOT NULL default ‘0’, UNIQUE KEY `name` (`name`)

) $tabletype “;

is it missing?

Last edited by Siguo (2010-04-09 07:14:32)

Offline

#2 2010-04-09 07:48:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: missing load_order field in setup sql?

Siguo wrote:

is it missing?

found it


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2010-04-09 08:13:53

Siguo
Member
From: Beijing, China
Registered: 2008-05-22
Posts: 44

Re: missing load_order field in setup sql?

hi, Bloke, thank you for pointing it out.
but where the setup script call it?

Offline

#4 2010-04-09 08:30:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: missing load_order field in setup sql?

Siguo wrote:

but where the setup script call it?

I believe1 that when you install TXP it runs the base setup SQL and then runs through each of the files in the update folder to apply any changes that have been made since.

1 My belief system may be incorrect


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2010-04-09 08:52:30

Siguo
Member
From: Beijing, China
Registered: 2008-05-22
Posts: 44

Re: missing load_order field in setup sql?

I re-checked the setup script, just as you said.

step 1: in the txpsql.php, there are just some base fields. in the txp_prefs table, it will set version with 1.0rc4

$create_sql[] = “INSERT INTO `”.PFX.“txp_prefs` VALUES (1, ‘version’, ‘1.0rc4’, 2, ‘publish’, ‘text_input’, 0, ‘’)”;

step 2: after you have setup, when you go to host/textpattern/index.php. there’s:

$dbversion = safe_field(‘val’,‘txp_prefs’,“name = ‘version’”);

if (!$dbversion or ($dbversion != $thisversion) or $txp_using_svn)
{ define(‘TXP_UPDATE’, 1);
include txpath.’/update/_update.php’;
}

so it will call ‘/update/_update.php’, and this file will call the update script from v4.02 to v4.2.0, hehe :)

Last edited by Siguo (2010-04-09 09:02:43)

Offline

#6 2010-04-10 20:55:42

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: missing load_order field in setup sql?

Bloke wrote:

I believe1 that when you install TXP it runs the base setup SQL and then runs through each of the files in the update folder to apply any changes that have been made since.

1 My belief system may be incorrect

It is not. I wonder if would be better to only use the update files for updating a existing installs and have an up-to-date set of SQL statements for new installs (no updates required). It would make it easier to see what the current DB table layout should look like without having to check all the files that are involved in the base install and updates.

Offline

Board footer

Powered by FluxBB