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

typeorm / typeorm / 19549987525

20 Nov 2025 08:11PM UTC coverage: 80.769% (+4.3%) from 76.433%
19549987525

push

github

web-flow
ci: run tests on commits to master and next (#11783)

Co-authored-by: Oleg "OSA413" Sokolov <OSA413@users.noreply.github.com>

26500 of 32174 branches covered (82.36%)

Branch coverage included in aggregate %.

91252 of 113615 relevant lines covered (80.32%)

88980.79 hits per line

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

39.29
/src/commands/SchemaDropCommand.ts
1
import ansi from "ansis"
26✔
2
import path from "path"
26✔
3
import process from "process"
26✔
4
import yargs from "yargs"
26✔
5
import { DataSource } from "../data-source/DataSource"
26✔
6
import { PlatformTools } from "../platform/PlatformTools"
26✔
7
import { CommandUtils } from "./CommandUtils"
26✔
8

26✔
9
/**
26✔
10
 * Drops all tables of the database from the given dataSource.
26✔
11
 */
26✔
12
export class SchemaDropCommand implements yargs.CommandModule {
208✔
13
    command = "schema:drop"
208✔
14
    describe =
208✔
15
        "Drops all tables in the database on your default dataSource. " +
208✔
16
        "To drop table of a concrete connection's database use -c option."
208✔
17

208✔
18
    builder(args: yargs.Argv) {
208✔
19
        return args.option("dataSource", {
×
20
            alias: "d",
×
21
            describe:
×
22
                "Path to the file where your DataSource instance is defined.",
×
23
            demandOption: true,
×
24
        })
×
25
    }
×
26

208✔
27
    async handler(args: yargs.Arguments) {
208✔
28
        let dataSource: DataSource | undefined = undefined
×
29
        try {
×
30
            dataSource = await CommandUtils.loadDataSource(
×
31
                path.resolve(process.cwd(), args.dataSource as string),
×
32
            )
×
33
            dataSource.setOptions({
×
34
                synchronize: false,
×
35
                migrationsRun: false,
×
36
                dropSchema: false,
×
37
                logging: ["query", "schema"],
×
38
            })
×
39
            await dataSource.initialize()
×
40
            await dataSource.dropDatabase()
×
41
            await dataSource.destroy()
×
42

×
43
            console.log(
×
44
                ansi.green`Database schema has been successfully dropped.`,
×
45
            )
×
46
        } catch (err) {
×
47
            PlatformTools.logCmdErr("Error during schema drop:", err)
×
48

×
49
            if (dataSource && dataSource.isInitialized)
×
50
                await dataSource.destroy()
×
51

×
52
            process.exit(1)
×
53
        }
×
54
    }
×
55
}
208✔
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