1. Santiago Payà Miralta
  2. genet

Commits

Santiago Payà Miralta  committed b76b1eb

More non profit editions.

  • Participants
  • Parent commits 64f218b
  • Branches default

Comments (0)

Files changed (4)

File control/genet_global.py

View file
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ################################################################################
-"""
-Start the schema creating the roles and the database in the DBMS:
-
-CREATE ROLE genet;
-CREATE DATABASE genet OWNER genet;
-CREATE SCHEMA AUTHORIZATION genet;
-CREATE ROLE santiago LOGIN;
-GRANT genet TO santiago;
-
-"""
 
 from model.db_connection import db
 from model import db_schema
 # *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
 # Deletes db schema.
 # *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
-def restartSchema():
-    """
-    *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
-    Restarts all the database sequences and schema tables.
-    *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
-
-    """
-    db_schema.emptySchema()
-    db_schema.fillSchema()
+#def restartSchema():
+#    """
+#    *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
+#    Restarts all the database sequences and schema tables.
+#    *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
+#
+#    """
+#    db_schema.emptySchema()
+#    db_schema.fillSchema()
 
 ##
 # *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
     *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
 
     """
-    st = "DROP SCHEMA genet CASCADE;" \
-        "CREATE SCHEMA AUTHORIZATION genet;"
+    st = "DROP SCHEMA public CASCADE;" \
+        "CREATE SCHEMA public AUTHORIZATION genet;"
     ret = st, db.query(st)
     ret = ret, db_schema.fillSchema()
     return ret
     # *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** *** DANGER *** 
     
     """
-    return str(input).zfill(2)
+    return str(input).zfill(4)

File doc/mind.xmind

Binary file modified.

File model/db_schema.py

View file
     # Return all outputs from queries.
     return ret
 
-def emptySchema():
-    """
-    Deletes all schematic tables.
-
-    """
-    st = """
-    DROP SEQUENCE IF EXISTS "gn____ids_seq" CASCADE;
-    DROP SEQUENCE IF EXISTS "gn____aux_seq" CASCADE;
-    DROP TABLE IF EXISTS "gn____tree" CASCADE;
-    DROP TABLE IF EXISTS "gn____levels" CASCADE;
-    DROP TABLE IF EXISTS "gn____node_types" CASCADE;
-    DROP TABLE IF EXISTS "gn____edge_types" CASCADE;
-    """
-    return st, db.query(st)
+#def emptySchema():
+#    """
+#    Deletes all schematic tables.
+#
+#    """
+#    st = """
+#    DROP SEQUENCE IF EXISTS "gn____ids_seq" CASCADE;
+#    DROP SEQUENCE IF EXISTS "gn____aux_seq" CASCADE;
+#    DROP TABLE IF EXISTS "gn____tree" CASCADE;
+#    DROP TABLE IF EXISTS "gn____levels" CASCADE;
+#    DROP TABLE IF EXISTS "gn____node_types" CASCADE;
+#    DROP TABLE IF EXISTS "gn____edge_types" CASCADE;
+#    """
+#    return st, db.query(st)
 
 ################################################################################
 # Level tables.

File view/genet_window.py

View file
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ################################################################################
+"""
+Start the schema creating the roles and the database in the DBMS as superuser:
+
+CREATE ROLE genet;
+CREATE DATABASE genet OWNER genet;
+\connect genet
+DROP SCHEMA public CASCADE;
+CREATE SCHEMA public AUTHORIZATION genet;
+CREATE ROLE santiago LOGIN;
+GRANT genet TO santiago;
+
+genet_global.restartDatabase() or 'Reset' button.
+
+"""
 
 ## TODO My emacs needs this
 import sys