Show
Ignore:
Timestamp:
04/19/05 17:17:02 (8 years ago)
Author:
fproulx
Message:

2005-04-18 Fran�ois Proulx <francois.proulx@…>

  • Added Flickr content support
  • Part of File object is done
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/include/schema_validate.php

    r553 r555  
    2929require_once BASEPATH.'classes/AbstractDb.php'; 
    3030require_once BASEPATH.'classes/Session.php'; 
    31 define('REQUIRED_SCHEMA_VERSION', 7); 
     31define('REQUIRED_SCHEMA_VERSION', 9); 
    3232 
    3333/** Check that the database schema is up to date.  If it isn't, offer to update it. */ 
     
    285285                        $sql .= "ALTER TABLE content ALTER COLUMN is_persistent SET DEFAULT FALSE;\n"; 
    286286                         
    287                                         } 
     287                } 
     288         
     289        $new_schema_version = 8; 
     290        if($schema_version < $new_schema_version) 
     291        { 
     292            echo "<h2>Preparing SQL statements to update schema to version  $new_schema_version</h2>";  
     293            $sql .= 
     294            "CREATE TABLE flickr_photostream 
     295            ( 
     296              flickr_photostream_id text NOT NULL, 
     297              api_key text, 
     298              photo_selection_mode text NOT NULL DEFAULT 'PSM_GROUP'::text, 
     299              user_id text, 
     300              user_name text, 
     301              tags text, 
     302              tag_mode varchar(10) DEFAULT 'any'::character varying, 
     303              group_id text, 
     304              random bool NOT NULL DEFAULT true, 
     305              min_taken_date timestamp, 
     306              max_taken_date timestamp, 
     307              photo_batch_size int4 DEFAULT 10, 
     308              photo_count int4 DEFAULT 1, 
     309              display_title bool NOT NULL DEFAULT true, 
     310              display_description bool NOT NULL DEFAULT false, 
     311              display_tags bool NOT NULL DEFAULT false, 
     312              CONSTRAINT flickr_photostream_pkey PRIMARY KEY (flickr_photostream_id), 
     313              CONSTRAINT flickr_photostream_content_group_fkey FOREIGN KEY (flickr_photostream_id) REFERENCES content_group (content_group_id) ON UPDATE CASCADE ON DELETE CASCADE 
     314            );"; 
     315        } 
     316         
     317        $new_schema_version = 9; 
     318        if($schema_version < $new_schema_version) 
     319        { 
     320            echo "<h2>Preparing SQL statements to update schema to version  $new_schema_version</h2>";  
     321            $sql .= 
     322            "CREATE TABLE files 
     323            ( 
     324              files_id text NOT NULL, 
     325              filename text, 
     326              mime_type text, 
     327              binary_data bytea,  
     328              CONSTRAINT files_pkey PRIMARY KEY (files_id) 
     329            );"; 
     330        } 
     331         
    288332                $db->ExecSqlUpdate("BEGIN;\n$sql\nCOMMIT;\n", true); 
    289333                echo "</html></head>";