VbzCart/docs/archive/tables: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | archive
Jump to navigation Jump to search
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...)
 
imported>Woozle
(ctg_updates now discarded)
Line 1: Line 1:
==on other pages==
* {{vbzcart|table|ctg_updates}}
==updates==
==updates==
* '''Purpose''': timestamps on tables so we know when update queries need to be run
* '''Purpose''': timestamps on tables so we know when update queries need to be run

Revision as of 23:50, 2 July 2009

on other pages

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 />