]> git.agnieray.net Git - galette.git/blobdiff - galette/install/scripts/pgsql.sql
Add association's documents management
[galette.git] / galette / install / scripts / pgsql.sql
index 16572bbcb5dc6696ab1be8581db10668c535315b..92bbe0099cfcb06486b17043cec4ae4d0df668f1 100644 (file)
@@ -165,6 +165,15 @@ CREATE SEQUENCE galette_socials_id_seq
     MINVALUE 1
     CACHE 1;
 
+-- sequence for documents
+DROP SEQUENCE IF EXISTS galette_documents_id_seq;
+CREATE SEQUENCE galette_documents_id_seq
+    START 1
+    INCREMENT 1
+    MAXVALUE 2147483647
+    MINVALUE 1
+    CACHE 1;
+
 -- Schema
 -- REMINDER: Create order IS important, dependencies first !!
 DROP TABLE IF EXISTS galette_paymenttypes CASCADE;
@@ -499,6 +508,20 @@ CREATE TABLE galette_socials (
 -- add index on table to look for type
 CREATE INDEX galette_socials_idx ON galette_socials (type);
 
+-- table for documents
+DROP TABLE IF EXISTS galette_documents CASCADE;
+CREATE TABLE galette_documents (
+  id_document integer DEFAULT nextval('galette_documents_id_seq'::text) NOT NULL,
+  type character varying(250) NOT NULL,
+  visible integer NOT NULL,
+  filename character varying(255) DEFAULT NULL,
+  comment text,
+  creation_date timestamp NOT NULL,
+  PRIMARY KEY (id_document)
+);
+-- add index on table to look for type
+CREATE INDEX galette_documents_idx ON galette_documents (type);
+
 -- table for database version
 DROP TABLE IF EXISTS galette_database CASCADE;
 CREATE TABLE galette_database (