Skip to content

Commit

Permalink
Merge branch 'r0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmafc committed Sep 22, 2014
2 parents c8b019c + e52b402 commit f01ba68
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pyrseas/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ def _link_refs(self, db):
"""Link related objects"""
if self.dbconn.version >= 90100:
langs = [lang[0] for lang in self.dbconn.fetchall(
"SELECT tmplname FROM pg_pltemplate")]
"""SELECT lanname FROM pg_language l
JOIN pg_depend p ON (l.oid = p.objid)
WHERE deptype = 'e' """)]
db.languages.link_refs(db.functions, langs)
copycfg = {}
if 'datacopy' in self.config:
Expand Down Expand Up @@ -379,11 +381,11 @@ def diff_map(self, input_map):
stmts.append(self.db.operfams._drop())
stmts.append(self.db.functions._drop())
stmts.append(self.db.types._drop())
stmts.append(self.db.extensions._drop())
stmts.append(self.db.schemas._drop())
stmts.append(self.db.servers._drop())
stmts.append(self.db.fdwrappers._drop())
stmts.append(self.db.languages._drop())
stmts.append(self.db.extensions._drop())
if 'datacopy' in self.config:
opts.data_dir = self.config['files']['data_path']
stmts.append(self.ndb.schemas.data_import(opts))
Expand Down
4 changes: 2 additions & 2 deletions pyrseas/dbobject/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def diff_map(self, inexts):
# check existing extensions
for ext in self:
exten = self[ext]
# if missing, drop them
# if missing, mark it for dropping
if ext not in inexts:
stmts.append(exten.drop())
exten.dropped = False

return stmts

Expand Down
1 change: 1 addition & 0 deletions tests/dbobject/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Test extensions"""

import pytest
import psycopg2

from pyrseas.testutils import DatabaseToMapTestCase
from pyrseas.testutils import InputMapToSqlTestCase, fix_indent
Expand Down
1 change: 0 additions & 1 deletion tests/dbobject/test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""Test functions"""

import pytest
import psycopg2

from pyrseas.testutils import DatabaseToMapTestCase
from pyrseas.testutils import InputMapToSqlTestCase, fix_indent
Expand Down
1 change: 1 addition & 0 deletions tests/dbobject/test_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Test languages"""

import pytest
import psycopg2

from pyrseas.testutils import DatabaseToMapTestCase
from pyrseas.testutils import InputMapToSqlTestCase
Expand Down

0 comments on commit f01ba68

Please sign in to comment.