Skip to content

Improve the _fix_plugin_schema.py #306

@matthieumarrast

Description

@matthieumarrast

Yesterday we tried to update an mfbase plugin with objects declared on the wrong "public" schema.

While trying to execute the _fix_plugin_schema.py* script, we face the error:

$ _fix_plugin_schema.py plugin_<my_plugin> plugin_<my_plugin>
ALTER TABLE public.<table> SET SCHEMA plugin_<my_plugin>
Traceback (most recent call last):
  File "/opt/metwork-mfbase-2.2/bin/_fix_plugin_schema.py", line 33, in <module>
    cur.execute(sql2)
psycopg2.errors.InvalidSchemaName: schema "plugin_<my_plugin>" does not exist

*the script is missing in the mfbase version 2.2.7, we get it manually.

=> in case the schema does not already exist, the script must also execute:

CREATE SCHEMA plugin_<my_plugin> AUTHORIZATION plugin_<my_plugin>;
GRANT USAGE ON SCHEMA plugin_<my_plugin> TO plugin_<my_plugin>;

to be added to the script.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions