Bug #942
closedLaunchedApplicationData timestamp is not initialized to not null
80%
Description
this causes Leginon session not remember last launched application since a query for recent time fails.
Updated by Eric Hou about 14 years ago
Here is the sql script to update the previous "LaunchedApplicationData" table schema.
alter table LaunchedApplicationData modify `DEF_timestamp` timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
I will write a script to do the update.
Thanks.
Eric
Updated by Eric Hou about 14 years ago
- Assignee changed from Anchi Cheng to Eric Hou
Updated by Eric Hou about 14 years ago
- % Done changed from 0 to 80
finished the update script. It locates under dbschema folder call "leginondbUpdate-r14897.py".
If you don't like the name, feel free to change it.
Thanks.
Eric
Updated by Eric Hou about 14 years ago
- Assignee changed from Eric Hou to Amber Herold
Updated by Eric Hou about 14 years ago
To test:
Don't use the newest leginonDBSchema.xml, (use the one does not have "null="NOT NULL" " on line 611) to create the default database.
From mysql command, type "show create table leginondb.LaunchedApplicationData"
you show see as follow:
LaunchedApplicationData | CREATE TABLE `LaunchedApplicationData` (
`DEF_id` int(16) NOT NULL AUTO_INCREMENT,
`DEF_timestamp` timestamp NULL DEFAULT NULL,
`REF|ApplicationData|application` int(20) DEFAULT NULL,
`SEQ|launchers` text,
`REF|SessionData|session` int(20) DEFAULT NULL,
PRIMARY KEY (`DEF_id`),
KEY `REF|SessionData|session` (`REF|SessionData|session`),
KEY `REF|ApplicationData|application` (`REF|ApplicationData|application`),
KEY `DEF_timestamp` (`DEF_timestamp`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
after run this python script you should see as follow:
LaunchedApplicationData | CREATE TABLE `LaunchedApplicationData` (
`DEF_id` int(16) NOT NULL AUTO_INCREMENT,
`DEF_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`REF|ApplicationData|application` int(20) DEFAULT NULL,
`SEQ|launchers` text,
`REF|SessionData|session` int(20) DEFAULT NULL,
PRIMARY KEY (`DEF_id`),
KEY `REF|SessionData|session` (`REF|SessionData|session`),
KEY `REF|ApplicationData|application` (`REF|ApplicationData|application`),
KEY `DEF_timestamp` (`DEF_timestamp`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
Updated by Amber Herold about 14 years ago
- Status changed from New to In Code Review
Updated by Amber Herold about 14 years ago
- Status changed from In Code Review to In Test
Updated by Amber Herold about 14 years ago
- Status changed from In Test to Closed
Updated by Anchi Cheng almost 14 years ago
- Affected Version changed from Appion/Leginon 2.0.0 to Appion/Leginon 2.1.0
It turns out that this bug was fixed in 2.0 branch as r14380 but was not merged back to the trunk.
Updated by Anchi Cheng almost 14 years ago
Rename dbschema/leginonDBupdate-14897.py to schema-r14891,py to be consistent with other schema update scripts so that we can search them easily. r15106 did this but noticed that r14897 is not where the xml file was committed. r15096 corrected that.