summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e69afcc)
raw | patch | inline | side by side (parent: e69afcc)
author | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 29 Mar 2011 20:13:53 +0000 (20:13 +0000) | ||
committer | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 29 Mar 2011 20:13:53 +0000 (20:13 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4583 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/rdbms_common.py | patch | blob | history | |
roundup/configuration.py | patch | blob | history |
index eb1b7c9a33e777053775b656a1c759a54ba25be2..b37f164dd42bd67a3fd2f03d247dc6a1d5419ab0 100644 (file)
# no changes
return 0
# no changes
return 0
+ if not self.config.RDBMS_ALLOW_ALTER:
+ raise DatabaseError(_('ALTER operation disallowed: %r -> %r.'%(old_spec, new_spec)))
+
logger = logging.getLogger('roundup.hyperdb')
logger.info('update_class %s'%spec.classname)
logger = logging.getLogger('roundup.hyperdb')
logger.info('update_class %s'%spec.classname)
def create_class(self, spec):
""" Create a database table according to the given spec.
"""
def create_class(self, spec):
""" Create a database table according to the given spec.
"""
+
+ if not self.config.RDBMS_ALLOW_CREATE:
+ raise DatabaseError(_('CREATE operation disallowed: "%s".'%spec.classname))
+
cols, mls = self.create_class_table(spec)
self.create_journal_table(spec)
cols, mls = self.create_class_table(spec)
self.create_journal_table(spec)
Drop the journal and multilink tables too.
"""
Drop the journal and multilink tables too.
"""
+
+ if not self.config.RDBMS_ALLOW_DROP:
+ raise DatabaseError(_('DROP operation disallowed: "%s".'%cn))
+
properties = spec[1]
# figure the multilinks
mls = []
properties = spec[1]
# figure the multilinks
mls = []
index b145e96ecc1d77ba77963ed80496786348174496..8b862627d1d9f5a84192c11b9689f78a9013bc21 100644 (file)
--- a/roundup/configuration.py
+++ b/roundup/configuration.py
"Only used in SQLite connections."),
(IntegerNumberOption, 'cache_size', '100',
"Size of the node cache (in elements)"),
"Only used in SQLite connections."),
(IntegerNumberOption, 'cache_size', '100',
"Size of the node cache (in elements)"),
+ (BooleanOption, "allow_create", "yes",
+ "Setting this option to 'no' protects the database against table creations."),
+ (BooleanOption, "allow_alter", "yes",
+ "Setting this option to 'no' protects the database against table alterations."),
+ (BooleanOption, "allow_drop", "yes",
+ "Setting this option to 'no' protects the database against table drops."),
(NullableOption, 'template', '',
"Name of the PostgreSQL template for database creation.\n"
"For database creation the template used has to match\n"
(NullableOption, 'template', '',
"Name of the PostgreSQL template for database creation.\n"
"For database creation the template used has to match\n"