File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,14 @@ def run_pg_dump() -> str:
131
131
def get_updated_schema (schema_file : str , updater_file : str ) -> str :
132
132
drop_db ()
133
133
schema_sql = open (schema_file ).read ()
134
+ # The schema sets the owner of every object explicitly. We actually want
135
+ # these objects to be owned by whichever user CMS uses, so we skip the
136
+ # OWNER TO commands and let the owners be defaulted to the current user.
137
+ schema_sql = '\n ' .join (
138
+ line
139
+ for line in schema_sql .splitlines ()
140
+ if not (line .startswith ('ALTER ' ) and ' OWNER TO ' in line )
141
+ )
134
142
updater_sql = open (updater_file ).read ()
135
143
# We need to do this in two separate connections, since the schema_sql sets
136
144
# some connection properties which we don't want.
You can’t perform that action at this time.
0 commit comments