+def check_existing_database_plugins(dsn: str):
+ """ Check that the database has the required plugins installed."""
+ with connect(dsn) as conn:
+ _require_version('PostgreSQL server',
+ conn.server_version_tuple(),
+ POSTGRESQL_REQUIRED_VERSION)
+ _require_version('PostGIS',
+ conn.postgis_version_tuple(),
+ POSTGIS_REQUIRED_VERSION)
+ _require_version('hstore',
+ conn.hstore_version_tuple(),
+ HSTORE_REQUIRED_VERSION)
+
+
+def setup_database_skeleton(dsn: str, rouser: Optional[str] = None) -> None: