#11978 closed enhancement (fixed)
Add drop_schema method to ConnectionBase class — at Version 11
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.5 |
Component: | database backend | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: |
Added |
||
Internal Changes: |
Description
After adding the method we can refactor the code in EnvironmentStub
to eliminate the SQL query: trunk/trac/test.py@13818:355#L349.
Change History (12)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
I like first approach and destroy_db
rather than drop_schema
. init_db
method already exists and only PostgreSQL uses schema.
comment:3 by , 9 years ago
Should we add the destroy_db
method to the DatabaseManager
class (tags/trac-1.1.3/trac/db/api.py@:324#L299) and IDatabaseConnector
interface (tags/trac-1.1.3/trac/db/api.py@:287#L262)? I started working on a patch with those changes and I'll finish it after the 1.1.4 release.
comment:4 by , 9 years ago
Well, I think that it would be good to add the destroy_db
method to those class and interface.
comment:5 by , 9 years ago
comment:7 by , 9 years ago
comment:8 by , 9 years ago
At least, I think use of finally
statement is wrong in [f247fb2d7/rjollos.git].
Traceback (most recent call last): File "./trac/test.py", line 35, in <module> locale_en = Locale.parse('en_US') NameError: name 'Locale' is not defined
-
trac/test.py
diff --git a/trac/test.py b/trac/test.py index 76aa37e..daa3e8f 100755
a b try: 31 31 from babel import Locale 32 32 except ImportError: 33 33 locale_en = None 34 finally:34 else: 35 35 locale_en = Locale.parse('en_US') 36 36 37 37 import trac.db.mysql_backend
by , 9 years ago
Attachment: | t11978-postgres-quote.diff added |
---|
comment:9 by , 9 years ago
Another thing: to_sql
and alter_column_types
methods of PostgresConnector
have the same issue in [d21966f3/rjollos.git]. Proposed changes in attachment:t11978-postgres-quote.diff.
comment:10 by , 9 years ago
Thanks, I made ticket #11998 so we can fix the quoting issues on 1.0-stable.
comment:11 by , 9 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in [13924:13925].
Or we could make the
table
argument ofdrop_table
default toNone
and drop all the tables whentable = None
: trunk/trac/db/api.py@13595:200#L184. Is one of the two approaches more preferable?