From 38bcb7971c42d0e7470fe7e0953c92c5bb46aec3 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Tue, 28 Apr 2009 14:45:46 +0300 Subject: [PATCH] londiste add-table: if schema is missing, create --- python/londiste/setup.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.39.5