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

tempestphp / tempest-framework / 12021710761

25 Nov 2024 06:54PM UTC coverage: 79.441% (-2.6%) from 81.993%
12021710761

push

github

web-flow
ci: close stale issues and pull requests

7879 of 9918 relevant lines covered (79.44%)

61.32 hits per line

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

0.0
/src/Tempest/Database/src/QueryStatements/DropConstraintStatement.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Database\QueryStatements;
6

7
use Tempest\Database\DatabaseDialect;
8
use Tempest\Database\QueryStatement;
9

10
final readonly class DropConstraintStatement implements QueryStatement
11
{
12
    public function __construct(
×
13
        private string $localTable,
14
        private string $foreign,
15
    ) {
16
    }
×
17

18
    public function compile(DatabaseDialect $dialect): string
×
19
    {
20
        [$foreignTable] = explode('.', $this->foreign);
×
21

22
        $constraintName = sprintf(
×
23
            'fk_%s_%s',
×
24
            strtolower($foreignTable),
×
25
            strtolower($this->localTable),
×
26
        );
×
27

28
        return match ($dialect) {
×
29
            DatabaseDialect::MYSQL => sprintf(
×
30
                'ALTER TABLE `%s` DROP CONSTRAINT %s',
×
31
                $foreignTable,
×
32
                $constraintName,
×
33
            ),
×
34
            default => '',
×
35
        };
×
36
    }
37
}
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

© 2026 Coveralls, Inc