diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..74248e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +schemup.egg-info +*.pyc diff --git a/schemup/dbs/postgres.py b/schemup/dbs/postgres.py index ffcac6e..766eb3b 100644 --- a/schemup/dbs/postgres.py +++ b/schemup/dbs/postgres.py @@ -40,23 +40,11 @@ def commit(self): def ensureSchemaTable(self): cur = self.conn.cursor() cur.execute( - "SELECT COUNT(*)" - " FROM information_schema.tables" - " WHERE table_name = 'schemup_tables'") - - if cur.fetchone()[0]: - return - - print "Creating schema table..." - cur.execute( - "CREATE TABLE schemup_tables (" + "CREATE TABLE IF NOT EXISTS schemup_tables (" " table_name VARCHAR NOT NULL," " version VARCHAR NOT NULL," " is_current BOOLEAN NOT NULL DEFAULT 'f'," " schema TEXT)") - - self.conn.commit() - def clearSchemaTable(self): self.execute("DELETE FROM schemup_tables")