1
|
-- SQL script to create reports database for PostgreSQL
|
2
|
--
|
3
|
-- To run, type: psql template1 < reports-pgsql.sql
|
4
|
--
|
5
|
-- $Id: reports-pgsql.sql,v 1.3 2003/10/23 08:32:20 chriskl Exp $
|
6
|
|
7
|
CREATE DATABASE phppgadmin;
|
8
|
|
9
|
\connect phppgadmin
|
10
|
|
11
|
CREATE TABLE ppa_reports (
|
12
|
report_id SERIAL,
|
13
|
report_name varchar(255) NOT NULL,
|
14
|
db_name varchar(255) NOT NULL,
|
15
|
date_created date DEFAULT NOW() NOT NULL,
|
16
|
created_by varchar(255) NOT NULL,
|
17
|
descr text,
|
18
|
report_sql text NOT NULL,
|
19
|
PRIMARY KEY (report_id)
|
20
|
);
|
21
|
|
22
|
-- Allow everyone to do everything with reports. This may
|
23
|
-- or may not be what you want.
|
24
|
GRANT SELECT,INSERT,UPDATE,DELETE ON ppa_reports TO PUBLIC;
|
25
|
GRANT SELECT,UPDATE ON ppa_reports_report_id_seq TO PUBLIC;
|
26
|
|