Block la création de shema sans table
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
name=CenRa_POSTGIS
|
||||
qgisMinimumVersion=3.0
|
||||
description=Permet de crée un dossier dans la base PostGis
|
||||
version=2.2
|
||||
version=2.3
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
email=si_besoin@cen-rhonealpes.fr
|
||||
|
||||
@@ -21,7 +21,7 @@ email=si_besoin@cen-rhonealpes.fr
|
||||
# Optional items:
|
||||
|
||||
# Uncomment the following line and add your changelog entries:
|
||||
changelog=<h2>CenRa_POSTGIS:</h2></br><p><h3>21/01/2025 - Version 2.2: </h3> - Correctif sur la longeur des nom.</br></p><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>22/10/2024 - Version 2.0:</h3>- Refont du code.</p>
|
||||
changelog=<h2>CenRa_POSTGIS:</h2></br><p><h3>22/01/2025 - Version 2.3: </h3> - Correctif sur la creation de projet.</p></br><p><h3>21/01/2025 - Version 2.2: </h3> - Correctif sur la longeur des nom.</br></p><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>22/10/2024 - Version 2.0:</h3>- Refont du code.</p>
|
||||
|
||||
# tags are comma separated with spaces allowed
|
||||
tags=cenra, postgis, database
|
||||
|
||||
@@ -7,7 +7,7 @@ from builtins import str
|
||||
from builtins import object
|
||||
import qgis
|
||||
from qgis.PyQt.QtCore import QSettings
|
||||
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
|
||||
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog,QMessageBox
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import *
|
||||
@@ -83,8 +83,11 @@ class Postgis_Creator(QDialog, EDITOR_CLASS):
|
||||
SQL_schema = "CREATE SCHEMA " + schema + ";"
|
||||
SQL_GRANT_SCHEMA="GRANT CREATE, USAGE ON SCHEMA "+schema+" TO grp_qgis; GRANT CREATE, USAGE ON SCHEMA "+schema+" TO grp_sig;"
|
||||
|
||||
cur.execute(SQL_schema)
|
||||
cur.execute(SQL_GRANT_SCHEMA)
|
||||
if self.couche_contour.isChecked() or self.couche_habitat.isChecked() or self.couche_travaux_prevus.isChecked() or self.couche_vierge.isChecked():
|
||||
cur.execute(SQL_schema)
|
||||
cur.execute(SQL_GRANT_SCHEMA)
|
||||
else:
|
||||
iface.messageBar().pushMessage("POSTGRESQL :", "Pas de couche sélectionnée, création refusée.", level=Qgis.Warning, duration=30)
|
||||
|
||||
### Creation de la table contour
|
||||
if self.couche_contour.isChecked(): # Verifie si la checkbox est cochee
|
||||
|
||||
Reference in New Issue
Block a user