diff options
| author | Marko Kreen | 2009-04-28 11:45:46 +0000 |
|---|---|---|
| committer | Marko Kreen | 2009-04-28 12:03:03 +0000 |
| commit | 38bcb7971c42d0e7470fe7e0953c92c5bb46aec3 (patch) | |
| tree | b4c9924a047307b75a42b6af92038d2cbb038bbc /python/londiste/setup.py | |
| parent | 88a3cfcbd56d304fc8155f6e87fcada7f3acfe5b (diff) | |
londiste add-table: if schema is missing, create
Diffstat (limited to 'python/londiste/setup.py')
| -rw-r--r-- | python/londiste/setup.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/londiste/setup.py b/python/londiste/setup.py index 62b2d24b..efc14ea8 100644 --- a/python/londiste/setup.py +++ b/python/londiste/setup.py @@ -136,6 +136,10 @@ class LondisteSetup(CascadeAdmin): # table not present on provider - nowhere to get the DDL from self.log.warning('Table "%s" missing on provider, skipping' % tbl) return + schema = skytools.fq_name_parts(tbl)[0] + if not skytools.exists_schema(dst_curs, schema): + q = "create schema %s" % skytools.quote_ident(schema) + dst_curs.execute(q) s = skytools.TableStruct(src_curs, tbl) src_db.commit() s.create(dst_curs, create_flags, log = self.log) |
