PHP Classes

File: SQL File

Recommend this page to a friend!
  Packages of Matthew Asham   Binkterm PHP   database/migrations/v1.11.0.72_file_area_url_links.sql   Download  
File: database/migrations/v1.11.0.72_file_area_url_links.sql
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Binkterm PHP
Bulletin board system based on the Web
Author: By
Last change:
Date: 5 days ago
Size: 645 bytes
 

Contents

Class file image Download
-- Add URL column to files table to support external link entries in file areas ALTER TABLE files ADD COLUMN url TEXT DEFAULT NULL; -- Allow NULL for file_hash and storage_path so URL-type link records (which -- have no physical file) can be stored without dummy values. ALTER TABLE files ALTER COLUMN file_hash DROP NOT NULL; ALTER TABLE files ALTER COLUMN storage_path DROP NOT NULL; -- The unique constraint on (file_area_id, file_hash) must also allow NULLs. -- PostgreSQL treats NULLs as distinct in unique indexes, so multiple NULL -- hashes in the same area will not collide ? no schema change is needed for -- the constraint itself.