File: commands.md

package info (click to toggle)
python-django-pgtrigger 4.15.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 956 kB
  • sloc: python: 4,412; makefile: 114; sh: 8; sql: 2
file content (97 lines) | stat: -rw-r--r-- 2,904 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Commands

`django-pgtrigger` comes with the `python manage.py pgtrigger` command, which has several subcommands that are described below.

## ls

List all triggers managed by `django-pgtrigger`.

**Options**

    [uris ...]
        Trigger URIs to list.

    -d, --database  List triggers on this database.
    -s, --schema  Use this schema as the search path. Can be provided multiple times.

**Ouput**

The following installation status markers are displayed:

- `INSTALLED`: The trigger is installed and up to date
- `OUTDATED`: The trigger is installed, but it has not been migrated to the current version.
- `UNINSTALLED`: The trigger is not installed.
- `PRUNE`: A trigger is no longer in the codebase and still installed.
- `UNALLOWED`: Trigger installation is not allowed for this database. Only applicable in a multi-database environment.

Note that every installed trigger, including ones that will be pruned, will show whether they are enabled or disabled. Disabled triggers are installed but do not run.

## install

Install triggers. If no arguments are provided, all triggers are installed and orphaned triggers are pruned.

**Options**

    [uris ...]
        Trigger URIs to install.

    -d, --database  Install triggers on this database.
    -s, --schema  Use this schema as the search path. Can be provided multiple times.

## uninstall

Uninstall triggers. If no arguments are provided, all triggers are uninstalled and orphaned triggers will be pruned.

!!! danger

    Running `uninstall` will globally uninstall triggers. If you need to temporarily ignore a trigger, see the [Ignoring Execution](ignoring_triggers.md) section.

**Options**

    [uris ...]
        Trigger URIs to uninstall.

    -d, --database  Uninstall triggers on this database.
    -s, --schema  Use this schema as the search path. Can be provided multiple times.

## enable

Enable triggers.

**Options**

    [uris ...]
        Trigger URIs to enable.

    -d, --database  Enable triggers on this database.
    -s, --schema  Use this schema as the search path. Can be provided multiple times.


## disable

Disable triggers.

!!! danger

    Running `disable` will globally disable the execution of triggers. If you need to temporarily ignore a trigger, see the [Ignoring Execution](ignoring_triggers.md) section.

**Options**

    [uris ...]
        Trigger URIs to enable.

    -d, --database  Disable triggers on this database.
    -s, --schema  Use this schema as the search path. Can be provided multiple times.

## prune

Uninstall any triggers managed by `django-pgtrigger` that are no longer in the codebase.

!!! note

    Pruning happens automatically when doing `python manage.py pgtrigger install` or `python manage.py pgtrigger uninstall`.

**Options**

    -d, --database  Prune triggers on this database.
    -s, --schema  Use this schema as the search path. Can be provided multiple times.