VbzCart/docs/archive/tables

From Woozle Writes Code
< VbzCart‎ | docs‎ | archive
Revision as of 19:25, 8 March 2009 by imported>Woozle (New page: ==updates== * '''Purpose''': timestamps on tables so we know when update queries need to be run * '''Status''': probably superceded by data flow tables and procs ===SQL=== <section begin=s...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

updates

  • Purpose: timestamps on tables so we know when update queries need to be run
  • Status: probably superceded by data flow tables and procs

SQL

<section begin=sql /><mysql> CREATE TABLE `updates` (

   `Name` varchar(32) NOT NULL COMMENT 'name of thing which gets updated',
   `Updated` datetime COMMENT 'when last updated',
  PRIMARY KEY(`Name`)
) ENGINE = MYISAM;</mysql>

<section end=sql />

Function to record an update (not tested): <section begin=sql /><mysql> CREATE PROCEDURE SetUpdate(IN iName varchar(32))

BEGIN
  REPLACE INTO updates(Name,Updated) values(iName, NOW());
END</mysql>

<section end=sql />