fmi...@adullact.net
unread,Nov 6, 2018, 10:15:03 AM11/6/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openmairie-o...@googlegroups.com
Author: fmichon
Date: 2018-11-06 16:15:00 +0100 (Tue, 06 Nov 2018)
New Revision: 853
Modified:
trunk/data/pgsql/install.sql
trunk/data/pgsql/make_init.sh
Log:
* Nettoyage du r?\195?\169pertoire data/
Modified: trunk/data/pgsql/install.sql
===================================================================
--- trunk/data/pgsql/install.sql 2018-10-31 11:16:52 UTC (rev 852)
+++ trunk/data/pgsql/install.sql 2018-11-06 15:15:00 UTC (rev 853)
@@ -4,28 +4,23 @@
-- ATTENTION ce script peut supprimer des données de votre base de données
-- il n'est à utiliser qu'en connaissance de cause
--
+-- Usage :
+-- cd data/pgsql/
+-- dropdb opencimetiere && createdb opencimetiere && psql opencimetiere -f install.sql
+--
-- @package opencimetiere
-- @version SVN : $Id$
--------------------------------------------------------------------------------
--- Usage :
--- cd data/pgsql/
--- dropdb opencimetiere && createdb opencimetiere && psql opencimetiere -f install.sql
-
--- Force l'encoding client à UTF8
-SET client_encoding = 'UTF8';
-
--- Nom du schéma
-\set schema 'opencimetiere'
-\set ON_ERROR_STOP on
-
--
START TRANSACTION;
+\set ON_ERROR_STOP on
-- Initialisation de postgis
CREATE EXTENSION IF NOT EXISTS postgis;
-- Suppression, Création et Utilisation du schéma
+\set schema 'opencimetiere'
DROP SCHEMA IF EXISTS :schema CASCADE;
CREATE SCHEMA :schema;
SET search_path = :schema, public, pg_catalog;
@@ -33,7 +28,7 @@
-- Instructions de base du framework openmairie
\i ../../core/data/pgsql/init.sql
--- Instructions de base de l'applicatif
+-- Instructions de base de l'applicatif
\i init_metier.sql
-- Initialisation du paramétrage
@@ -44,4 +39,6 @@
\i v4.0.0.dev0.sql
\i v4.0.0.dev0.init_data.sql
+--
COMMIT;
+
Modified: trunk/data/pgsql/make_init.sh
===================================================================
--- trunk/data/pgsql/make_init.sh 2018-10-31 11:16:52 UTC (rev 852)
+++ trunk/data/pgsql/make_init.sh 2018-11-06 15:15:00 UTC (rev 853)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
##
# Ce script permet de générer les fichiers sql d'initialisation de la base de
# données pour permettre de publier une nouvelle version facilement
@@ -14,8 +14,7 @@
sudo su postgres -c "pg_dump -s -O -n $schema -T $schema.om_* $database" > init_metier.sql
# Suppression du schéma
-sed -i "s/CREATE SCHEMA $schema;/-- CREATE SCHEMA $schema;/g" init*.sql
-sed -i "s/^SET/-- SET/g" init*.sql sed -i "s/^SET/-- SET/g" init*.sql
+sed -i "s/^CREATE SCHEMA $schema;/-- CREATE SCHEMA $schema;/g" init*.sql
+sed -i "s/^SET/-- SET/g" init*.sql
sed -i "s/^SELECT pg_catalog.set_config/-- SELECT pg_catalog.set_config/g" init*.sql
sed -i "s/$schema\.//g" init*.sql
-