PHP Classes

File: src/Installer/sql/pgsql/23-blog-comments.sql

Recommend this page to a friend!
  Classes of Scott Arciszewski   CMS Airship   src/Installer/sql/pgsql/23-blog-comments.sql   Download  
File: src/Installer/sql/pgsql/23-blog-comments.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,127 bytes
 

Contents

Class file image Download
CREATE TABLE IF NOT EXISTS hull_blog_comments ( commentid BIGSERIAL PRIMARY KEY, blogpost BIGINT REFERENCES hull_blog_posts(postid), replyto BIGINT NULL, author BIGINT NULL REFERENCES hull_blog_authors(authorid), metadata JSONB, approved BOOLEAN DEFAULT FALSE, created TIMESTAMP DEFAULT NOW(), modified TIMESTAMP DEFAULT NOW() ); CREATE INDEX ON hull_blog_comments (replyto); CREATE TABLE IF NOT EXISTS hull_blog_comment_versions ( versionid BIGSERIAL PRIMARY KEY, comment BIGINT REFERENCES hull_blog_comments(commentid), approved BOOLEAN DEFAULT FALSE, message TEXT, created TIMESTAMP DEFAULT NOW(), modified TIMESTAMP DEFAULT NOW() ); DROP TRIGGER IF EXISTS update_hull_blog_comments_modtime ON hull_blog_comments; CREATE TRIGGER update_hull_blog_comments_modtime BEFORE UPDATE ON hull_blog_comments FOR EACH ROW EXECUTE PROCEDURE update_modtime(); DROP TRIGGER IF EXISTS update_hull_blog_comment_vesrions_modtime ON hull_blog_comment_versions; CREATE TRIGGER update_hull_blog_comment_versions_modtime BEFORE UPDATE ON hull_blog_comment_versions FOR EACH ROW EXECUTE PROCEDURE update_modtime();