PHP Classes

File: src/Installer/sql/pgsql/22-blog-authors.sql

Recommend this page to a friend!
  Classes of Scott Arciszewski   CMS Airship   src/Installer/sql/pgsql/22-blog-authors.sql   Download  
File: src/Installer/sql/pgsql/22-blog-authors.sql
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: CMS Airship
Content management system with security features
Author: By
Last change: PHPStorm only committed one file -_-
Add 'IF NOT EXISTS' clauses (requires PostgreSQL 9.5)
Date: 7 years ago
Size: 1,527 bytes
 

Contents

Class file image Download
CREATE TABLE IF NOT EXISTS hull_blog_authors ( authorid BIGSERIAL PRIMARY KEY, name TEXT, bio_format TEXT, biography TEXT, byline TEXT, slug TEXT, created TIMESTAMP DEFAULT NOW(), modified TIMESTAMP DEFAULT NOW() ); CREATE UNIQUE INDEX ON hull_blog_authors (slug); CREATE TABLE IF NOT EXISTS hull_blog_author_owners ( userid BIGINT, authorid BIGINT, default_author_for_user BOOLEAN DEFAULT FALSE, in_charge BOOLEAN DEFAULT FALSE, created TIMESTAMP DEFAULT NOW() ); CREATE INDEX ON hull_blog_author_owners (userid); CREATE INDEX ON hull_blog_author_owners (authorid); CREATE UNIQUE INDEX ON hull_blog_author_owners (userid, authorid); ALTER TABLE airship_files ADD author BIGINT NULL REFERENCES hull_blog_authors (authorid); ALTER TABLE hull_blog_series ADD author BIGINT NULL REFERENCES hull_blog_authors (authorid); CREATE INDEX ON hull_blog_authors (authorid); CREATE TABLE IF NOT EXISTS hull_blog_photo_contexts ( contextid BIGSERIAL PRIMARY KEY, label TEXT, display_name TEXT ); CREATE UNIQUE INDEX ON hull_blog_photo_contexts (label); CREATE TABLE IF NOT EXISTS hull_blog_author_photos ( photoid BIGSERIAL PRIMARY KEY, author BIGINT REFERENCES hull_blog_authors (authorid), file BIGINT REFERENCES airship_files (fileid), context BIGINT REFERENCES hull_blog_photo_contexts (contextid), created TIMESTAMP DEFAULT NOW(), modified TIMESTAMP DEFAULT NOW() ); CREATE UNIQUE INDEX ON hull_blog_author_photos (author, context);