[rhmessaging-commits] rhmessaging commits: r1726 - in mgmt/mint: sql and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Feb 26 11:34:01 EST 2008


Author: justi9
Date: 2008-02-26 11:34:01 -0500 (Tue, 26 Feb 2008)
New Revision: 1726

Modified:
   mgmt/mint/python/mint/__init__.py
   mgmt/mint/sql/schema.sql
Log:
Add a new model object, ConsoleUser; generate a new schema file; introduce check and init methods on MintDatabase

Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py	2008-02-26 16:23:41 UTC (rev 1725)
+++ mgmt/mint/python/mint/__init__.py	2008-02-26 16:34:01 UTC (rev 1726)
@@ -71,6 +71,12 @@
   value = StringCol(length=1000, default=None)
   type = StringCol(length=1, default="s")
 
+class ConsoleUser(SQLObject):
+  name = StringCol(length=1000, default=None)
+  password = StringCol(length=1000, default=None)
+  lastChallenged = TimestampCol(default=None)
+  lastLoggedOut = TimestampCol(default=None)
+
 class OriginalIdDict:
   def __init__(self):
     self.idMap = dict()
@@ -315,6 +321,13 @@
   def getConnection(self):
     return connectionForURI(self.uri).getConnection()
 
+  def check(self):
+    self.checkConnection()
+
+  def init(self):
+    conn = connectionForURI(self.uri)
+    sqlhub.processConnection = conn
+
   def checkConnection(self):
     conn = self.getConnection()
 

Modified: mgmt/mint/sql/schema.sql
===================================================================
--- mgmt/mint/sql/schema.sql	2008-02-26 16:23:41 UTC (rev 1725)
+++ mgmt/mint/sql/schema.sql	2008-02-26 16:34:01 UTC (rev 1726)
@@ -37,6 +37,14 @@
     type VARCHAR(1)
 );
 
+CREATE TABLE console_user (
+    id SERIAL PRIMARY KEY,
+    name VARCHAR(1000),
+    password VARCHAR(1000),
+    last_challenged TIMESTAMP,
+    last_logged_out TIMESTAMP
+);
+
 CREATE TABLE binding (
     id SERIAL PRIMARY KEY,
     id_original BIGINT,
@@ -80,8 +88,7 @@
     initial_disk_page_size INT,
     initial_pages_per_queue INT,
     cluster_name VARCHAR(1000),
-    version VARCHAR(1000),
-    registration_id INT
+    version VARCHAR(1000)
 );
 
 CREATE TABLE broker_stats (
@@ -378,8 +385,6 @@
 
 ALTER TABLE broker ADD CONSTRAINT system_id_exists FOREIGN KEY (system_id) REFERENCES system (id) ON DELETE SET NULL;
 
-ALTER TABLE broker ADD CONSTRAINT registration_id_exists FOREIGN KEY (registration_id) REFERENCES broker_registration (id) ON DELETE SET NULL;
-
 ALTER TABLE broker_stats ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE SET NULL;
 
 ALTER TABLE client ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES client_stats (id) ON DELETE SET NULL;
@@ -457,3 +462,4 @@
 ALTER TABLE vhost ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE SET NULL;
 
 ALTER TABLE vhost_stats ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES vhost (id) ON DELETE SET NULL;
+




More information about the rhmessaging-commits mailing list