• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lorinkoz / django-pgschemas / 10262409303

06 Aug 2024 07:45AM UTC coverage: 58.477%. Remained the same
10262409303

push

github

lorinkoz
Bump mypy from 1.11.0 to 1.11.1

Bumps [mypy](https://github.com/python/mypy) from 1.11.0 to 1.11.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.11...v1.11.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

914 of 1563 relevant lines covered (58.48%)

7.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/django_pgschemas/management/commands/createrefschema.py
1
from django.core.checks import Tags, run_checks
×
2
from django.core.management.base import BaseCommand, CommandError
×
3

4
from django_pgschemas.utils import create_schema, drop_schema, get_clone_reference
×
5

6

7
class Command(BaseCommand):
×
8
    help = "Creates the reference schema for faster dynamic tenant creation"
×
9

10
    def _run_checks(self, **kwargs):  # pragma: no cover
11
        issues = run_checks(tags=[Tags.database])
12
        issues.extend(super()._run_checks(**kwargs))
13
        return issues
14

15
    def add_arguments(self, parser):
×
16
        super().add_arguments(parser)
×
17
        parser.add_argument(
×
18
            "--recreate",
19
            action="store_true",
20
            dest="recreate",
21
            help="Recreate reference schema.",
22
        )
23

24
    def handle(self, *args, **options):
×
25
        clone_reference = get_clone_reference()
×
26
        if not clone_reference:
×
27
            raise CommandError("There is no reference schema configured.")
×
28
        if options.get("recreate", False):
×
29
            drop_schema(clone_reference, check_if_exists=True, verbosity=options["verbosity"])
×
30
            if options["verbosity"] >= 1:
×
31
                self.stdout.write("Destroyed existing reference schema.")
×
32
        created = create_schema(
×
33
            clone_reference, check_if_exists=True, verbosity=options["verbosity"]
34
        )
35
        if options["verbosity"] >= 1:
×
36
            if created:
×
37
                self.stdout.write("Reference schema successfully created!")
×
38
            else:
39
                self.stdout.write("Reference schema already exists.")
×
40
                self.stdout.write(
×
41
                    self.style.WARNING(
42
                        "Run this command again with --recreate if you want to recreate the reference schema."
43
                    )
44
                )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc